Class: Laborantin::Metaprog::Resolutions::Resolution
- Inherits:
-
Object
- Object
- Laborantin::Metaprog::Resolutions::Resolution
- Defined in:
- lib/laborantin/core/resolutions.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, &blk) ⇒ Resolution
constructor
A new instance of Resolution.
- #resolve!(*ary) ⇒ Object
Constructor Details
#initialize(name, &blk) ⇒ Resolution
Returns a new instance of Resolution.
27 28 29 30 |
# File 'lib/laborantin/core/resolutions.rb', line 27 def initialize(name, &blk) @name = name @block = blk end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
26 27 28 |
# File 'lib/laborantin/core/resolutions.rb', line 26 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
26 27 28 |
# File 'lib/laborantin/core/resolutions.rb', line 26 def name @name end |
Instance Method Details
#resolve!(*ary) ⇒ Object
32 33 34 35 |
# File 'lib/laborantin/core/resolutions.rb', line 32 def resolve!(*ary) raise RuntimeError, "no block to resolve #{self}" unless block block.call(*ary) end |