Class: Hcp::Resource
- Inherits:
-
Object
- Object
- Hcp::Resource
- Defined in:
- lib/hcp/resource.rb
Overview
A record as Housecall Pro answered it.
Direct Known Subclasses
Address, Customer, Employee, Estimate, Estimate::Option, Job, Job::Appointment, Job::Invoice, LineItem, Note, Schedule
Class Method Summary collapse
-
.amount(name, key = name) ⇒ Object
Declares a reader for a sum Housecall Pro counts in cents.
-
.attribute(name, key = name) ⇒ Object
Declares a reader for what Housecall Pro answers under a name.
-
.timestamp(name, key = name) ⇒ Object
Declares a reader for a moment Housecall Pro stamps.
Instance Method Summary collapse
-
#id ⇒ String
The ID Housecall Pro files the record under.
-
#initialize(node: {}, company_id: nil) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(node: {}, company_id: nil) ⇒ Resource
Returns a new instance of Resource.
26 27 28 29 |
# File 'lib/hcp/resource.rb', line 26 def initialize(node: {}, company_id: nil) @node = node @company_id = company_id end |
Class Method Details
.amount(name, key = name) ⇒ Object
Declares a reader for a sum Housecall Pro counts in cents.
21 |
# File 'lib/hcp/resource.rb', line 21 def amount(name, key = name) = define_method(name) { money key.to_s } |
.attribute(name, key = name) ⇒ Object
Declares a reader for what Housecall Pro answers under a name.
9 |
# File 'lib/hcp/resource.rb', line 9 def attribute(name, key = name) = define_method(name) { @node[key.to_s] } |
.timestamp(name, key = name) ⇒ Object
Declares a reader for a moment Housecall Pro stamps.
15 |
# File 'lib/hcp/resource.rb', line 15 def (name, key = name) = define_method(name) { time key.to_s } |
Instance Method Details
#id ⇒ String
Returns the ID Housecall Pro files the record under.
32 |
# File 'lib/hcp/resource.rb', line 32 def id = @node['id'] |