Class: MoxiworksPlatform::Agent

Inherits:
Resource
  • Object
show all
Defined in:
lib/moxiworks_platform/agent.rb

Overview

Moxi Works Platform Agent

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resource

accept_header, attr_accessor, attributes, #attributes, auth_header, check_for_error_in_response, content_type_header, #float_attrs, headers, #initialize, #int_attrs, #method_missing, #numeric_attrs, #numeric_value_for, #to_hash

Constructor Details

This class inherits a constructor from MoxiworksPlatform::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MoxiworksPlatform::Resource

Instance Attribute Details

#accreditationString

Returns containing any accreditation the agent has.

Returns:

  • (String)

    containing any accreditation the agent has



22
23
24
# File 'lib/moxiworks_platform/agent.rb', line 22

def accreditation
  @accreditation
end

#address_cityString

Returns the agent’s address, city.

Returns:

  • (String)

    the agent’s address, city



32
33
34
# File 'lib/moxiworks_platform/agent.rb', line 32

def address_city
  @address_city
end

#address_stateString

Returns the agent’s address, state.

Returns:

  • (String)

    the agent’s address, state



37
38
39
# File 'lib/moxiworks_platform/agent.rb', line 37

def address_state
  @address_state
end

#address_streetString

Returns the agent’s address, street and number.

Returns:

  • (String)

    the agent’s address, street and number



27
28
29
# File 'lib/moxiworks_platform/agent.rb', line 27

def address_street
  @address_street
end

#address_zipString

Returns the agent’s address, zip code.

Returns:

  • (String)

    the agent’s address, zip code



42
43
44
# File 'lib/moxiworks_platform/agent.rb', line 42

def address_zip
  @address_zip
end

#birth_dateString

Returns the agent’s date of birth.

Returns:

  • (String)

    the agent’s date of birth



137
138
139
# File 'lib/moxiworks_platform/agent.rb', line 137

def birth_date
  @birth_date
end

#facebookString

Returns the agent’s facebook page.

Returns:

  • (String)

    the agent’s facebook page



127
128
129
# File 'lib/moxiworks_platform/agent.rb', line 127

def facebook
  @facebook
end

#fax_phone_numberString

Returns the agent’s fax phone number.

Returns:

  • (String)

    the agent’s fax phone number



87
88
89
# File 'lib/moxiworks_platform/agent.rb', line 87

def fax_phone_number
  @fax_phone_number
end

#google_plusString

Returns the agent’s google plus acount.

Returns:

  • (String)

    the agent’s google plus acount



122
123
124
# File 'lib/moxiworks_platform/agent.rb', line 122

def google_plus
  @google_plus
end

#home_pageString

Returns the agent’s home page url.

Returns:

  • (String)

    the agent’s home page url



132
133
134
# File 'lib/moxiworks_platform/agent.rb', line 132

def home_page
  @home_page
end

#home_phone_numberString

Returns the agent’s home phone number.

Returns:

  • (String)

    the agent’s home phone number



82
83
84
# File 'lib/moxiworks_platform/agent.rb', line 82

def home_phone_number
  @home_phone_number
end

#languagesArray

Returns an array of strings representing any languages the agent speaks.

Returns:

  • (Array)

    an array of strings representing any languages the agent speaks



112
113
114
# File 'lib/moxiworks_platform/agent.rb', line 112

def languages
  @languages
end

#licenseString

Returns the agent’s license number.

Returns:

  • (String)

    the agent’s license number



72
73
74
# File 'lib/moxiworks_platform/agent.rb', line 72

def license
  @license
end

#main_phone_numberString

Returns the agent’s main phone number.

Returns:

  • (String)

    the agent’s main phone number



92
93
94
# File 'lib/moxiworks_platform/agent.rb', line 92

def main_phone_number
  @main_phone_number
end

#mlsArray

Returns containing strings representing the MLSs the agent is a member of.

Returns:

  • (Array)

    containing strings representing the MLSs the agent is a member of



17
18
19
# File 'lib/moxiworks_platform/agent.rb', line 17

def mls
  @mls
end

#mobile_phone_numberString

Returns the agent’s fax phone number.

Returns:

  • (String)

    the agent’s fax phone number



77
78
79
# File 'lib/moxiworks_platform/agent.rb', line 77

def mobile_phone_number
  @mobile_phone_number
end

#moxi_works_agent_idString

moxi_works_agent_id is the Moxi Works Platform ID of the agent which a contact is or is to be associated with.

this must be set for any Moxi Works Platform transaction

Returns:

  • (String)

    the Moxi Works Platform ID of the agent



12
13
14
# File 'lib/moxiworks_platform/agent.rb', line 12

def moxi_works_agent_id
  @moxi_works_agent_id
end

#nameString

Returns the agent’s full name.

Returns:

  • (String)

    the agent’s full name



67
68
69
# File 'lib/moxiworks_platform/agent.rb', line 67

def name
  @name
end

#office_address_cityString

Returns the agent’s office address, city.

Returns:

  • (String)

    the agent’s office address, city



52
53
54
# File 'lib/moxiworks_platform/agent.rb', line 52

def office_address_city
  @office_address_city
end

#office_address_stateString

Returns the agent’s office address, state.

Returns:

  • (String)

    the agent’s office address, state



57
58
59
# File 'lib/moxiworks_platform/agent.rb', line 57

def office_address_state
  @office_address_state
end

#office_address_streetString

Returns the agent’s office address, street and number.

Returns:

  • (String)

    the agent’s office address, street and number



47
48
49
# File 'lib/moxiworks_platform/agent.rb', line 47

def office_address_street
  @office_address_street
end

#office_address_zipString

Returns the agent’s office address, zip code.

Returns:

  • (String)

    the agent’s office address, zip code



62
63
64
# File 'lib/moxiworks_platform/agent.rb', line 62

def office_address_zip
  @office_address_zip
end

#office_phone_numberString

Returns the agent’s office_phone number.

Returns:

  • (String)

    the agent’s office_phone number



97
98
99
# File 'lib/moxiworks_platform/agent.rb', line 97

def office_phone_number
  @office_phone_number
end

#primary_email_addressString

Returns the agent’s date of birth.

Returns:

  • (String)

    the agent’s date of birth



102
103
104
# File 'lib/moxiworks_platform/agent.rb', line 102

def primary_email_address
  @primary_email_address
end

#profile_image_urlString

Returns url to a full size image of the agent.

Returns:

  • (String)

    url to a full size image of the agent



147
148
149
# File 'lib/moxiworks_platform/agent.rb', line 147

def profile_image_url
  @profile_image_url
end

#profile_thumb_urlString

Returns url to a thumb size image of the agent.

Returns:

  • (String)

    url to a thumb size image of the agent



152
153
154
# File 'lib/moxiworks_platform/agent.rb', line 152

def profile_thumb_url
  @profile_thumb_url
end

#secondary_email_addressString

Returns the agent’s secondary email address.

Returns:

  • (String)

    the agent’s secondary email address



107
108
109
# File 'lib/moxiworks_platform/agent.rb', line 107

def secondary_email_address
  @secondary_email_address
end

#titleString

Returns the agent’s title.

Returns:

  • (String)

    the agent’s title



142
143
144
# File 'lib/moxiworks_platform/agent.rb', line 142

def title
  @title
end

#twitterString

Returns the agent’s twitter handle.

Returns:

  • (String)

    the agent’s twitter handle



117
118
119
# File 'lib/moxiworks_platform/agent.rb', line 117

def twitter
  @twitter
end

Class Method Details

.find(opts = {}) ⇒ MoxiworksPlatform::Contact

Find an Agent on the Moxi Works Platform

Parameters:

  • opts (Hash) (defaults to: {})

    named parameter Hash

Options Hash (opts):

  • :moxi_works_agent_id (String)

    REQUIRED The Moxi Works Agent ID for the agent to which this contact is to be associated

Returns:

Raises:

  • ::MoxiworksPlatform::Exception::ArgumentError if required named parameters aren’t included



163
164
165
166
# File 'lib/moxiworks_platform/agent.rb', line 163

def self.find(opts={})
  url = "#{MoxiworksPlatform::Config.url}/api/agents/#{opts[:moxi_works_agent_id]}"
  self.send_request(:get, opts, url)
end

.send_request(method, opts = {}, url = nil) ⇒ Object



168
169
170
171
172
173
174
175
176
# File 'lib/moxiworks_platform/agent.rb', line 168

def self.send_request(method, opts={}, url=nil)
  url ||= "#{MoxiworksPlatform::Config.url}/api/agents"
  required_opts = [:moxi_works_agent_id]
  required_opts.each do |opt|
    raise ::MoxiworksPlatform::Exception::ArgumentError, "#{opt} required" if
        opts[opt].nil? or opts[opt].to_s.empty?
  end
  super(method, opts, url)
end