Class: MoxiworksPlatform::Agent
- Defined in:
- lib/moxiworks_platform/agent.rb
Overview
Moxi Works Platform Agent
Instance Attribute Summary collapse
-
#accreditation ⇒ String
Containing any accreditation the agent has.
-
#address_city ⇒ String
The agent’s address, city.
-
#address_state ⇒ String
The agent’s address, state.
-
#address_street ⇒ String
The agent’s address, street and number.
-
#address_zip ⇒ String
The agent’s address, zip code.
-
#birth_date ⇒ String
The agent’s date of birth.
-
#facebook ⇒ String
The agent’s facebook page.
-
#fax_phone_number ⇒ String
The agent’s fax phone number.
-
#google_plus ⇒ String
The agent’s google plus acount.
-
#home_page ⇒ String
The agent’s home page url.
-
#home_phone_number ⇒ String
The agent’s home phone number.
-
#languages ⇒ Array
An array of strings representing any languages the agent speaks.
-
#license ⇒ String
The agent’s license number.
-
#main_phone_number ⇒ String
The agent’s main phone number.
-
#mls ⇒ Array
Containing strings representing the MLSs the agent is a member of.
-
#mobile_phone_number ⇒ String
The agent’s fax phone number.
-
#moxi_works_agent_id ⇒ String
moxi_works_agent_id is the Moxi Works Platform ID of the agent which a contact is or is to be associated with.
-
#name ⇒ String
The agent’s full name.
-
#office_address_city ⇒ String
The agent’s office address, city.
-
#office_address_state ⇒ String
The agent’s office address, state.
-
#office_address_street ⇒ String
The agent’s office address, street and number.
-
#office_address_zip ⇒ String
The agent’s office address, zip code.
-
#office_phone_number ⇒ String
The agent’s office_phone number.
-
#primary_email_address ⇒ String
The agent’s date of birth.
-
#profile_image_url ⇒ String
Url to a full size image of the agent.
-
#profile_thumb_url ⇒ String
Url to a thumb size image of the agent.
-
#secondary_email_address ⇒ String
The agent’s secondary email address.
-
#title ⇒ String
The agent’s title.
-
#twitter ⇒ String
The agent’s twitter handle.
Class Method Summary collapse
-
.find(opts = {}) ⇒ MoxiworksPlatform::Contact
Find an Agent on the Moxi Works Platform.
- .send_request(method, opts = {}, url = nil) ⇒ Object
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
#accreditation ⇒ String
Returns containing any accreditation the agent has.
22 23 24 |
# File 'lib/moxiworks_platform/agent.rb', line 22 def accreditation @accreditation end |
#address_city ⇒ String
Returns the agent’s address, city.
32 33 34 |
# File 'lib/moxiworks_platform/agent.rb', line 32 def address_city @address_city end |
#address_state ⇒ String
Returns the agent’s address, state.
37 38 39 |
# File 'lib/moxiworks_platform/agent.rb', line 37 def address_state @address_state end |
#address_street ⇒ String
Returns 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_zip ⇒ String
Returns the agent’s address, zip code.
42 43 44 |
# File 'lib/moxiworks_platform/agent.rb', line 42 def address_zip @address_zip end |
#birth_date ⇒ String
Returns the agent’s date of birth.
137 138 139 |
# File 'lib/moxiworks_platform/agent.rb', line 137 def birth_date @birth_date end |
#facebook ⇒ String
Returns the agent’s facebook page.
127 128 129 |
# File 'lib/moxiworks_platform/agent.rb', line 127 def facebook @facebook end |
#fax_phone_number ⇒ String
Returns 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_plus ⇒ String
Returns the agent’s google plus acount.
122 123 124 |
# File 'lib/moxiworks_platform/agent.rb', line 122 def google_plus @google_plus end |
#home_page ⇒ String
Returns 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_number ⇒ String
Returns 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 |
#languages ⇒ Array
Returns 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 |
#license ⇒ String
Returns the agent’s license number.
72 73 74 |
# File 'lib/moxiworks_platform/agent.rb', line 72 def license @license end |
#main_phone_number ⇒ String
Returns 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 |
#mls ⇒ Array
Returns 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_number ⇒ String
Returns 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_id ⇒ String
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
12 13 14 |
# File 'lib/moxiworks_platform/agent.rb', line 12 def moxi_works_agent_id @moxi_works_agent_id end |
#name ⇒ String
Returns the agent’s full name.
67 68 69 |
# File 'lib/moxiworks_platform/agent.rb', line 67 def name @name end |
#office_address_city ⇒ String
Returns 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_state ⇒ String
Returns 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_street ⇒ String
Returns 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_zip ⇒ String
Returns 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_number ⇒ String
Returns 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_address ⇒ String
Returns 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_url ⇒ String
Returns 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_url ⇒ String
Returns 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_address ⇒ String
Returns 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 |
#title ⇒ String
Returns the agent’s title.
142 143 144 |
# File 'lib/moxiworks_platform/agent.rb', line 142 def title @title end |
#twitter ⇒ String
Returns 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
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 |