Class: Stacks::Items::Proc
- Inherits:
-
Object
- Object
- Stacks::Items::Proc
- Defined in:
- lib/stacks/items/proc.rb
Instance Method Summary collapse
-
#initialize(identifier, proc) ⇒ Proc
constructor
A new instance of Proc.
- #key ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(identifier, proc) ⇒ Proc
Returns a new instance of Proc.
3 4 5 6 |
# File 'lib/stacks/items/proc.rb', line 3 def initialize(identifier, proc) @identifier = identifier @proc = proc end |
Instance Method Details
#key ⇒ Object
8 9 10 |
# File 'lib/stacks/items/proc.rb', line 8 def key @key ||= @identifier end |
#value ⇒ Object
12 13 14 |
# File 'lib/stacks/items/proc.rb', line 12 def value @proc.call end |