Class: House
- Inherits:
-
Object
- Object
- House
- Defined in:
- lib/house_test.rb
Overview
Object to represent a client creating objects against a server
Instance Attribute Summary collapse
-
#handler ⇒ Object
Handles API calls.
-
#id ⇒ Object
Attributes mapping to fields in the backend.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ House
constructor
Create a new house.
Constructor Details
#initialize(params = {}) ⇒ House
Create a new house
33 34 35 36 37 |
# File 'lib/house_test.rb', line 33 def initialize(params = {}) self.handler = HouseHandler exchange = handler.post(body: params) self.id = exchange.response.body end |
Instance Attribute Details
#handler ⇒ Object
Handles API calls
26 27 28 |
# File 'lib/house_test.rb', line 26 def handler @handler end |
#id ⇒ Object
Attributes mapping to fields in the backend
28 29 30 |
# File 'lib/house_test.rb', line 28 def id @id end |