Class: Cot::Property
- Inherits:
-
Object
- Object
- Cot::Property
- Defined in:
- lib/cot/property.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Property
constructor
A new instance of Property.
- #value(&block) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Property
Returns a new instance of Property.
4 5 6 |
# File 'lib/cot/property.rb', line 4 def initialize(params = {}) @args = params end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
3 4 5 |
# File 'lib/cot/property.rb', line 3 def args @args end |
Instance Method Details
#value(&block) ⇒ Object
8 9 10 11 |
# File 'lib/cot/property.rb', line 8 def value(&block) return args[:value] unless block args[:value] = block end |