Class: Configurations::Maps::Blocks::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/configurations/maps/blocks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ Entry

Returns a new instance of Entry.



7
8
9
# File 'lib/configurations/maps/blocks.rb', line 7

def initialize(block)
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



5
6
7
# File 'lib/configurations/maps/blocks.rb', line 5

def block
  @block
end

Instance Method Details

#evaluate!(value) ⇒ Object



11
12
13
14
# File 'lib/configurations/maps/blocks.rb', line 11

def evaluate!(value)
  return value unless @block
  block.call(value)
end