Class: FruitToLime::Coworker

Inherits:
Object
  • Object
show all
Includes:
SerializeHelper
Defined in:
lib/fruit_to_lime/model/coworker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializeHelper

#get_import_rows, get_import_rows, #map_symbol_to_row, #map_to_row, serialize, #serialize, #serialize_to_file, serialize_to_file, serialize_variables, #symbol_to_name

Constructor Details

#initializeCoworker

Returns a new instance of Coworker.



7
8
# File 'lib/fruit_to_lime/model/coworker.rb', line 7

def initialize()
end

Instance Attribute Details

#direct_phone_numberObject

Returns the value of attribute direct_phone_number.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def direct_phone_number
  @direct_phone_number
end

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def first_name
  @first_name
end

#home_phone_numberObject

Returns the value of attribute home_phone_number.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def home_phone_number
  @home_phone_number
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def id
  @id
end

#integration_idObject

Returns the value of attribute integration_id.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def integration_id
  @integration_id
end

#last_nameObject

Returns the value of attribute last_name.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def last_name
  @last_name
end

#mobile_phone_numberObject

Returns the value of attribute mobile_phone_number.



4
5
6
# File 'lib/fruit_to_lime/model/coworker.rb', line 4

def mobile_phone_number
  @mobile_phone_number
end

Instance Method Details

#==(that) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/fruit_to_lime/model/coworker.rb', line 30

def ==(that)
    if that.nil?
        return false
    end

    if that.is_a? Coworker
        return @integration_id == that.integration_id
    elsif that.is_a? String
        return @integration_id == that
    end

    return false
end

#serialize_nameObject



26
27
28
# File 'lib/fruit_to_lime/model/coworker.rb', line 26

def serialize_name
    "Coworker"
end

#serialize_variablesObject



10
11
12
13
14
15
# File 'lib/fruit_to_lime/model/coworker.rb', line 10

def serialize_variables
    [
     :id, :integration_id, :first_name, :last_name, :email,
     :direct_phone_number, :mobile_phone_number, :home_phone_number
    ].map {|p| { :id => p, :type => :string } }
end

#to_referenceObject



17
18
19
20
21
22
23
24
# File 'lib/fruit_to_lime/model/coworker.rb', line 17

def to_reference
    reference = CoworkerReference.new
    reference.id = @id
    reference.integration_id = @integration_id
    reference.heading = "#{@first_name} #{@last_name}".strip

    return reference
end