Class: Napster::Models::LibraryDateTime
- Inherits:
-
Object
- Object
- Napster::Models::LibraryDateTime
- Defined in:
- lib/napster/models/library_date_time.rb
Overview
LibraryDateTime model Only used for /me/library/updated
Constant Summary collapse
- ATTRIBUTES =
[:date, :time_zone, :time_in_millis].freeze
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(arg) ⇒ LibraryDateTime
constructor
A new instance of LibraryDateTime.
Constructor Details
#initialize(arg) ⇒ LibraryDateTime
Returns a new instance of LibraryDateTime.
18 19 20 21 22 23 24 |
# File 'lib/napster/models/library_date_time.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 |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
16 17 18 |
# File 'lib/napster/models/library_date_time.rb', line 16 def client @client end |
Class Method Details
.collection(arg) ⇒ Object
26 27 28 29 30 |
# File 'lib/napster/models/library_date_time.rb', line 26 def self.collection(arg) arg[:data].map do |library_date_time| LibraryDateTime.new(data: library_date_time, client: @client) end end |