Class: Rory::Initializers::Initializer

Inherits:
Object
  • Object
show all
Defined in:
lib/rory/initializers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, block) ⇒ Initializer

Returns a new instance of Initializer.



8
9
10
11
# File 'lib/rory/initializers.rb', line 8

def initialize(name, block)
  @name = name
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



6
7
8
# File 'lib/rory/initializers.rb', line 6

def block
  @block
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/rory/initializers.rb', line 6

def name
  @name
end

Instance Method Details

#==(initializer) ⇒ Object



13
14
15
# File 'lib/rory/initializers.rb', line 13

def ==(initializer)
  name == initializer.name
end

#call(app) ⇒ Object



21
22
23
# File 'lib/rory/initializers.rb', line 21

def call(app)
  block.call(app)
end

#inspectObject



17
18
19
# File 'lib/rory/initializers.rb', line 17

def inspect
 "<Initializer '#{name}'>"
end