Class: Amorail::Property
- Inherits:
-
Object
- Object
- Amorail::Property
- Defined in:
- lib/amorail/property.rb
Overview
:nodoc: all
Defined Under Namespace
Classes: Company, Contact, Lead, PropertyItem, StatusItem, Task
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#company ⇒ Object
readonly
Returns the value of attribute company.
-
#contacts ⇒ Object
readonly
Returns the value of attribute contacts.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#leads ⇒ Object
readonly
Returns the value of attribute leads.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
-
#initialize(client) ⇒ Property
constructor
A new instance of Property.
- #inspect ⇒ Object
- #load_fields ⇒ Object
- #reload ⇒ Object
Constructor Details
#initialize(client) ⇒ Property
Returns a new instance of Property.
60 61 62 63 |
# File 'lib/amorail/property.rb', line 60 def initialize(client) @client = client reload end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def client @client end |
#company ⇒ Object (readonly)
Returns the value of attribute company.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def company @company end |
#contacts ⇒ Object (readonly)
Returns the value of attribute contacts.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def contacts @contacts end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def data @data end |
#leads ⇒ Object (readonly)
Returns the value of attribute leads.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def leads @leads end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
57 58 59 |
# File 'lib/amorail/property.rb', line 57 def tasks @tasks end |
Instance Method Details
#inspect ⇒ Object
78 79 80 |
# File 'lib/amorail/property.rb', line 78 def inspect @data end |
#load_fields ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/amorail/property.rb', line 70 def load_fields response = client.safe_request( :get, '/private/api/v2/json/accounts/current' ) response.body["response"]["account"] end |
#reload ⇒ Object
65 66 67 68 |
# File 'lib/amorail/property.rb', line 65 def reload @data = load_fields parse_all_data end |