class MusicTodayApiWrapper::Resources::Checkout::Session

Attributes

address[RW]
id[RW]
items[RW]

Public Class Methods

from_hash(session_hash) click to toggle source
# File lib/resources/checkout/session.rb, line 16
def self.from_hash(session_hash)
  address = Address.from_hash(session_hash)
  session = Session.new(session_hash['sessionId'], address)
  session_hash['items'].each do |item|
    session.items << Resources::Purchase::Item.from_hash(item)
  end
  session
end
new(id, address, items = []) click to toggle source
# File lib/resources/checkout/session.rb, line 10
def initialize(id, address, items = [])
  @id = id
  @address = address
  @items = items
end