Class: Rox::Core::CustomProperty
- Inherits:
-
Object
- Object
- Rox::Core::CustomProperty
- Defined in:
- lib/rox/core/properties/custom_property.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, value = nil, &block) ⇒ CustomProperty
constructor
A new instance of CustomProperty.
- #value(context) ⇒ Object
Constructor Details
#initialize(name, type, value = nil, &block) ⇒ CustomProperty
Returns a new instance of CustomProperty.
6 7 8 9 10 11 |
# File 'lib/rox/core/properties/custom_property.rb', line 6 def initialize(name, type, value = nil, &block) @name = name @type = type @value = value @block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
4 5 6 |
# File 'lib/rox/core/properties/custom_property.rb', line 4 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/rox/core/properties/custom_property.rb', line 4 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/rox/core/properties/custom_property.rb', line 4 def type @type end |
Instance Method Details
#value(context) ⇒ Object
13 14 15 |
# File 'lib/rox/core/properties/custom_property.rb', line 13 def value(context) @block.nil? ? @value : @block.call(context) end |