Class: MoveToGo::DealStatusSetting

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializeHelper

#get_import_rows, #serialize, #serialize_to_file

Constructor Details

#initialize(opt = nil) ⇒ DealStatusSetting

Returns a new instance of DealStatusSetting.



8
9
10
11
12
13
14
15
# File 'lib/move-to-go/model/deal_status_setting.rb', line 8

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

#assessmentObject

Returns the value of attribute assessment.



6
7
8
# File 'lib/move-to-go/model/deal_status_setting.rb', line 6

def assessment
  @assessment
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/move-to-go/model/deal_status_setting.rb', line 6

def id
  @id
end

#integration_idObject

Returns the value of attribute integration_id.



6
7
8
# File 'lib/move-to-go/model/deal_status_setting.rb', line 6

def integration_id
  @integration_id
end

#labelObject

Returns the value of attribute label.



6
7
8
# File 'lib/move-to-go/model/deal_status_setting.rb', line 6

def label
  @label
end

Instance Method Details

#same_as?(other) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/move-to-go/model/deal_status_setting.rb', line 33

def same_as?(other)
    if @integration_id != nil && @integration_id == other.integration_id
        return true
    end

    if @id != nil && @id == other.id
        return true
    end

    if @label != nil && @label == other.label
        return true
    end

    return false
end

#serialize_nameObject



21
22
23
# File 'lib/move-to-go/model/deal_status_setting.rb', line 21

def serialize_name
    "DealStatus"
end

#serialize_variablesObject



17
18
19
# File 'lib/move-to-go/model/deal_status_setting.rb', line 17

def serialize_variables
    [ :id, :integration_id, :label, :assessment ].map{ |p| { :id => p, :type => :string } }
end

#to_referenceObject



25
26
27
28
29
30
31
# File 'lib/move-to-go/model/deal_status_setting.rb', line 25

def to_reference()
    reference = DealStatusReference.new
    reference.label = @label
    reference.integration_id = @integration_id

    return reference
end