Class: Billy::Package

Inherits:
BaseModel show all
Defined in:
lib/billy/package.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

.find(permalink) ⇒ Object



4
5
6
7
# File 'lib/billy/package.rb', line 4

def self.find(permalink)
  attributes = Billy::Request.request('product/package', :permalink => permalink)
  attributes.is_a?(Hash) ? self.new(attributes) : nil
end

Instance Method Details

#hidden?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/billy/package.rb', line 9

def hidden?
  self.attributes.include?('hidden') && self.hidden
end