Class: Respect::Rails::EngineInfo

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/respect/rails/engine_info.rb

Direct Known Subclasses

ApplicationInfo

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (EngineInfo) initialize(engine_class)

A new instance of EngineInfo



6
7
8
9
10
11
# File 'lib/respect/rails/engine_info.rb', line 6

def initialize(engine_class)
  unless engine_class < ::Rails::Engine
    raise "'#{engine_class}' must be an ancestor of ::Rails::Engine."
  end
  @engine_class = engine_class
end

Instance Attribute Details

- (Object) engine_class (readonly)

Returns the value of attribute engine_class



13
14
15
# File 'lib/respect/rails/engine_info.rb', line 13

def engine_class
  @engine_class
end

- (Object) routes

Returns the value of attribute routes



19
20
21
# File 'lib/respect/rails/engine_info.rb', line 19

def routes
  @routes
end

Instance Method Details

- (Object) <=>(other)



21
22
23
# File 'lib/respect/rails/engine_info.rb', line 21

def <=>(other)
  self.name <=> other.name
end

- (Object) name



15
16
17
# File 'lib/respect/rails/engine_info.rb', line 15

def name
  @engine_class.engine_name.underscore
end