Class: MoveToGo::CustomValue
- Inherits:
-
Object
- Object
- MoveToGo::CustomValue
- Includes:
- SerializeHelper
- Defined in:
- lib/move-to-go/model/customfield.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #get_import_rows ⇒ Object
-
#initialize(opt = nil) ⇒ CustomValue
constructor
A new instance of CustomValue.
- #serialize_name ⇒ Object
- #serialize_variables ⇒ Object
Methods included from SerializeHelper
#serialize, #serialize_to_file
Constructor Details
#initialize(opt = nil) ⇒ CustomValue
Returns a new instance of CustomValue.
63 64 65 66 67 68 69 70 |
# File 'lib/move-to-go/model/customfield.rb', line 63 def initialize(opt=nil) if opt != nil serialize_variables.each do |myattr| val = opt[myattr[:id]] instance_variable_set("@" + myattr[:id].to_s, val) if val != nil end end end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
61 62 63 |
# File 'lib/move-to-go/model/customfield.rb', line 61 def field @field end |
#value ⇒ Object
Returns the value of attribute value.
61 62 63 |
# File 'lib/move-to-go/model/customfield.rb', line 61 def value @value end |
Instance Method Details
#get_import_rows ⇒ Object
77 78 79 80 81 |
# File 'lib/move-to-go/model/customfield.rb', line 77 def get_import_rows serialize_variables.map do |p| map_to_row p end end |
#serialize_name ⇒ Object
83 84 85 |
# File 'lib/move-to-go/model/customfield.rb', line 83 def serialize_name "CustomValue" end |
#serialize_variables ⇒ Object
72 73 74 75 |
# File 'lib/move-to-go/model/customfield.rb', line 72 def serialize_variables [ { :id =>:field, :type => :custom_field_reference }, { :id =>:value, :type => :string }] end |