Class: Castaway::Element::Base::Attribute

Inherits:
Struct
  • Object
show all
Defined in:
lib/castaway/element/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#_initialObject

Returns the value of attribute _initial

Returns:

  • (Object)

    the current value of _initial



16
17
18
# File 'lib/castaway/element/base.rb', line 16

def _initial
  @_initial
end

#fnObject

Returns the value of attribute fn

Returns:

  • (Object)

    the current value of fn



16
17
18
# File 'lib/castaway/element/base.rb', line 16

def fn
  @fn
end

Instance Method Details

#[](memo, value) ⇒ Object



25
26
27
# File 'lib/castaway/element/base.rb', line 25

def [](memo, value)
  fn[memo, value]
end

#initialObject



17
18
19
20
21
22
23
# File 'lib/castaway/element/base.rb', line 17

def initial
  if _initial.respond_to?(:call)
    _initial.call
  else
    _initial
  end
end