Class: Datasource::Serializer::TemplatePart
- Inherits:
-
Struct
- Object
- Struct
- Datasource::Serializer::TemplatePart
- Defined in:
- lib/datasource/serializer.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#select ⇒ Object
Returns the value of attribute select.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(parent, type = nil, value = nil) ⇒ TemplatePart
constructor
A new instance of TemplatePart.
- #set_default_value(value = nil) ⇒ Object
Constructor Details
#initialize(parent, type = nil, value = nil) ⇒ TemplatePart
Returns a new instance of TemplatePart.
4 5 6 |
# File 'lib/datasource/serializer.rb', line 4 def initialize(parent, type = nil, value = nil) super(parent, type, get_default_value(type, value), []) end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent
3 4 5 |
# File 'lib/datasource/serializer.rb', line 3 def parent @parent end |
#select ⇒ Object
Returns the value of attribute select
3 4 5 |
# File 'lib/datasource/serializer.rb', line 3 def select @select end |
#type ⇒ Object
Returns the value of attribute type
3 4 5 |
# File 'lib/datasource/serializer.rb', line 3 def type @type end |
#value ⇒ Object
Returns the value of attribute value
3 4 5 |
# File 'lib/datasource/serializer.rb', line 3 def value @value end |
Instance Method Details
#set_default_value(value = nil) ⇒ Object
8 9 10 |
# File 'lib/datasource/serializer.rb', line 8 def set_default_value(value = nil) self.value = get_default_value(type, value) end |