Class: MoveToGo::CustomField

Inherits:
Object
  • Object
show all
Includes:
ModelWithIntegrationIdSameAs, SerializeHelper
Defined in:
lib/move-to-go/model/customfield.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializeHelper

#serialize, #serialize_to_file

Methods included from ModelWithIntegrationIdSameAs

#same_as?

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

#idObject

Returns the value of attribute id.



33
34
35
# File 'lib/move-to-go/model/customfield.rb', line 33

def id
  @id
end

#integration_idObject

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

#titleObject

Returns the value of attribute title.



33
34
35
# File 'lib/move-to-go/model/customfield.rb', line 33

def title
  @title
end

#typeObject

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_rowsObject



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_nameObject



54
55
56
# File 'lib/move-to-go/model/customfield.rb', line 54

def serialize_name
    "CustomField"
end

#serialize_variablesObject



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