Class: PlayTime::Upload

Inherits:
Object
  • Object
show all
Defined in:
lib/play_time/upload.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Upload

Returns a new instance of Upload.



11
12
13
# File 'lib/play_time/upload.rb', line 11

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



9
10
11
# File 'lib/play_time/upload.rb', line 9

def client
  @client
end

Class Method Details

.upload(track) ⇒ Object



5
6
7
# File 'lib/play_time/upload.rb', line 5

def self.upload(track)
  new(Client.new).upload(track)
end

Instance Method Details

#upload(track) ⇒ Object



15
16
17
18
19
# File 'lib/play_time/upload.rb', line 15

def upload(track)
  client.authorize!

  client.commit(track)
end