Class: MoveToGo::DealStatus
- Inherits:
-
Object
- Object
- MoveToGo::DealStatus
- Includes:
- SerializeHelper
- Defined in:
- lib/move-to-go/model/deal_status.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#history ⇒ Object
Returns the value of attribute history.
-
#id ⇒ Object
Returns the value of attribute id.
-
#status_reference ⇒ Object
Returns the value of attribute status_reference.
Instance Method Summary collapse
-
#initialize(opt = nil) ⇒ DealStatus
constructor
A new instance of DealStatus.
- #serialize_variables ⇒ Object
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
#date ⇒ Object
Returns the value of attribute date.
5 6 7 |
# File 'lib/move-to-go/model/deal_status.rb', line 5 def date @date end |
#history ⇒ Object
Returns the value of attribute history.
5 6 7 |
# File 'lib/move-to-go/model/deal_status.rb', line 5 def history @history end |
#id ⇒ Object
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_reference ⇒ Object
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_variables ⇒ Object
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 |