Class: Seedie::FieldValues::CustomValue

Inherits:
Object
  • Object
show all
Defined in:
lib/seedie/field_values/custom_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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_valueObject (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_valueObject



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