class Giftrocket::Style
Attributes
card[RW]
id[RW]
Public Class Methods
list(filters={})
click to toggle source
# File lib/giftrocket/style.rb, line 16 def self.list(filters={}) options = filters.merge(Giftrocket.default_options) response = Giftrocket::Request.get 'styles', query: options, format: 'json' response[:styles].map do |style_attributes| Giftrocket::Style.new(style_attributes) end end
new(attributes)
click to toggle source
# File lib/giftrocket/style.rb, line 6 def initialize(attributes) attributes = attributes.with_indifferent_access self.id = attributes[:id] self.card = attributes[:card] end
Public Instance Methods
url()
click to toggle source
# File lib/giftrocket/style.rb, line 12 def url card && card[:url] end