Class: MoveToGo::DealStatus

Inherits:
Object
  • Object
show all
Includes:
SerializeHelper
Defined in:
lib/move-to-go/model/deal_status.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) ⇒ DealStatus

Returns a new instance of DealStatus.



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

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

#dateObject

Returns the value of attribute date.



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

def date
  @date
end

#historyObject

Returns the value of attribute history.



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

def history
  @history
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#status_referenceObject

Returns the value of attribute status_reference.



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

def status_reference
  @status_reference
end

Instance Method Details

#serialize_variablesObject



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

def serialize_variables
    [ :id, :label, :history ].map{ |p| { :id => p, :type => :string } } +
        [ :date ].map { |p| { :id => p, :type => :date } } +
        [ :status_reference ].map { |p| { :id => p, :type => :deal_status_reference } }
end