Class: Seedie::FieldValues::CustomValue
- Inherits:
-
Object
- Object
- Seedie::FieldValues::CustomValue
- Defined in:
- lib/seedie/field_values/custom_value.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parsed_value ⇒ Object
readonly
Returns the value of attribute parsed_value.
Instance Method Summary collapse
- #generate_custom_field_value ⇒ Object
-
#initialize(name, value_template, index) ⇒ CustomValue
constructor
A new instance of CustomValue.
Constructor Details
#initialize(name, value_template, index) ⇒ CustomValue
Returns a new instance of CustomValue.
8 9 10 11 12 13 14 15 |
# File 'lib/seedie/field_values/custom_value.rb', line 8 def initialize(name, value_template, index) @name = name @value_template = value_template @index = index @parsed_value = "" ValueTemplateValidator.new(@value_template, @index, @name).validate end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/seedie/field_values/custom_value.rb', line 6 def name @name end |
#parsed_value ⇒ Object (readonly)
Returns the value of attribute parsed_value.
6 7 8 |
# File 'lib/seedie/field_values/custom_value.rb', line 6 def parsed_value @parsed_value end |
Instance Method Details
#generate_custom_field_value ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/seedie/field_values/custom_value.rb', line 17 def generate_custom_field_value if @value_template.is_a?(String) generate_custom_value_from_string else generate_custom_value_from_hash end parsed_value end |