class Fountain::Slots

Fountain Slot collection

Attributes

current_page[R]

Collection current page

last_page[R]

Collection last page

slots[R]

Slot collection

Public Class Methods

new(data) click to toggle source

@param [Hash] data Raw slot data

# File lib/fountain/slots.rb, line 24
def initialize(data)
  raw_data = Util.stringify_hash_keys data
  pagination = raw_data['pagination']
  if pagination.is_a? Hash
    @current_page = pagination['current']
    @last_page = pagination['last']
  end
  @slots = raw_data['slots'].map { |attr| Slot.new attr }
end

Public Instance Methods

inspect() click to toggle source
# File lib/fountain/slots.rb, line 34
def inspect
  format(
    '#<%<class_name>s:0x%<object_id>p @count="%<count>s">',
    class_name: self.class.name,
    object_id: object_id,
    count: count
  )
end