Class: MoveToGo::CoworkerReference
- Inherits:
-
Object
- Object
- MoveToGo::CoworkerReference
- Includes:
- SerializeHelper
- Defined in:
- lib/move-to-go/model/coworker_reference.rb
Instance Attribute Summary collapse
-
#heading ⇒ Object
Returns the value of attribute heading.
-
#id ⇒ Object
Returns the value of attribute id.
-
#integration_id ⇒ Object
Returns the value of attribute integration_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opt = nil) ⇒ CoworkerReference
constructor
A new instance of CoworkerReference.
- #serialize_name ⇒ Object
- #serialize_variables ⇒ Object
Methods included from SerializeHelper
#get_import_rows, #serialize, #serialize_to_file
Constructor Details
#initialize(opt = nil) ⇒ CoworkerReference
Returns a new instance of CoworkerReference.
6 7 8 9 10 11 12 13 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 6 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
#heading ⇒ Object
Returns the value of attribute heading.
4 5 6 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 4 def heading @heading end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 4 def id @id end |
#integration_id ⇒ Object
Returns the value of attribute integration_id.
4 5 6 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 4 def integration_id @integration_id end |
Class Method Details
.from_coworker(coworker) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 23 def self.from_coworker(coworker) if coworker.nil? return nil elsif coworker.is_a?(Coworker) return coworker.to_reference elsif coworker.is_a?(CoworkerReference) return coworker end end |
Instance Method Details
#serialize_name ⇒ Object
19 20 21 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 19 def serialize_name "CoworkerReference" end |
#serialize_variables ⇒ Object
15 16 17 |
# File 'lib/move-to-go/model/coworker_reference.rb', line 15 def serialize_variables [:id, :integration_id, :heading].map {|p| {:id => p, :type => :string} } end |