class Napster::Models::Chart

Chart model

Constants

ATTRIBUTES

Attributes

client[RW]

Public Class Methods

collection(arg) click to toggle source
# File lib/napster/models/chart.rb, line 27
def self.collection(arg)
  arg[:data].map do |chart|
    Chart.new(data: chart, client: @client)
  end
end
new(arg) click to toggle source
# File lib/napster/models/chart.rb, line 18
def initialize(arg)
  @client = arg[:client] if arg[:client]
  return unless arg[:data]

  ATTRIBUTES.each do |attribute|
    send("#{attribute}=", arg[:data][attribute.to_s.camel_case_lower])
  end
end