Class: Charger::Product
- Inherits:
-
Object
- Object
- Charger::Product
- Includes:
- Resource
- Defined in:
- lib/charger/product.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.client ⇒ Object
41 42 43 |
# File 'lib/charger/product.rb', line 41 def self.client Charger.client end |
.find_by_product_family_id(id) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/charger/product.rb', line 29 def self.find_by_product_family_id id products = [] client.get("product_families/#{id}/products") do |data| products << new(data['product']) end products end |
Instance Method Details
#persisted? ⇒ Boolean
37 38 39 |
# File 'lib/charger/product.rb', line 37 def persisted? !!id end |