Class: Billy::Product
Instance Attribute Summary
Attributes inherited from BaseModel
#attributes
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseModel
#initialize, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Billy::BaseModel
Class Method Details
.info ⇒ Object
4
5
6
7
|
# File 'lib/billy/product.rb', line 4
def self.info
attributes = Billy::Request.request('product/info')
attributes.is_a?(Hash) ? self.new(attributes) : nil
end
|
Instance Method Details
#addons ⇒ Object
13
14
15
|
# File 'lib/billy/product.rb', line 13
def addons
@addons ||= Billy::Request.request('product/addons').map { |addon| Billy::Addon.new(addon) }
end
|
#packages ⇒ Object
9
10
11
|
# File 'lib/billy/product.rb', line 9
def packages
@packages ||= Billy::Request.request('product/packages').map { |package| Billy::Package.new(package) }
end
|