Class: MoveToGo::CustomField
- Inherits:
-
Object
- Object
- MoveToGo::CustomField
- Includes:
- ModelWithIntegrationIdSameAs, SerializeHelper
- Defined in:
- lib/move-to-go/model/customfield.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#integration_id ⇒ Object
Returns the value of attribute integration_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #get_import_rows ⇒ Object
-
#initialize(opt = nil) ⇒ CustomField
constructor
A new instance of CustomField.
- #serialize_name ⇒ Object
- #serialize_variables ⇒ Object
Methods included from SerializeHelper
#serialize, #serialize_to_file
Methods included from ModelWithIntegrationIdSameAs
Constructor Details
#initialize(opt = nil) ⇒ CustomField
Returns a new instance of CustomField.
35 36 37 38 39 40 41 42 |
# File 'lib/move-to-go/model/customfield.rb', line 35 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
#id ⇒ Object
Returns the value of attribute id.
33 34 35 |
# File 'lib/move-to-go/model/customfield.rb', line 33 def id @id end |
#integration_id ⇒ Object
Returns the value of attribute integration_id.
33 34 35 |
# File 'lib/move-to-go/model/customfield.rb', line 33 def integration_id @integration_id end |
#title ⇒ Object
Returns the value of attribute title.
33 34 35 |
# File 'lib/move-to-go/model/customfield.rb', line 33 def title @title end |
#type ⇒ Object
Returns the value of attribute type.
33 34 35 |
# File 'lib/move-to-go/model/customfield.rb', line 33 def type @type end |
Instance Method Details
#get_import_rows ⇒ Object
48 49 50 51 52 |
# File 'lib/move-to-go/model/customfield.rb', line 48 def get_import_rows serialize_variables.map do |p| map_to_row p end end |
#serialize_name ⇒ Object
54 55 56 |
# File 'lib/move-to-go/model/customfield.rb', line 54 def serialize_name "CustomField" end |
#serialize_variables ⇒ Object
44 45 46 |
# File 'lib/move-to-go/model/customfield.rb', line 44 def serialize_variables [:id, :integration_id, :title, :type].map {|p| { :id => p, :type => :string } } end |