Class: Billy::Product

Inherits:
BaseModel show all
Defined in:
lib/billy/product.rb

Instance Attribute Summary

Attributes inherited from BaseModel

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#initialize, #method_missing

Constructor Details

This class inherits a constructor from Billy::BaseModel

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Billy::BaseModel

Class Method Details

.infoObject



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

#addonsObject



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

#packagesObject



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