Class: Auphonic::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/gst-kitchen/auphonic/account.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Account

Returns a new instance of Account.



9
10
11
12
# File 'lib/gst-kitchen/auphonic/account.rb', line 9

def initialize(options={})
  @username = options["user"]
  @password = options["pass"]
end

Instance Attribute Details

#passwordObject (readonly)

Returns the value of attribute password.



2
3
4
# File 'lib/gst-kitchen/auphonic/account.rb', line 2

def password
  @password
end

#usernameObject (readonly)

Returns the value of attribute username.



2
3
4
# File 'lib/gst-kitchen/auphonic/account.rb', line 2

def username
  @username
end

Class Method Details

.init_from_systemObject



4
5
6
7
# File 'lib/gst-kitchen/auphonic/account.rb', line 4

def self.init_from_system
  auphonic_credentials = Yajl::Parser.parse(File.read(File.expand_path("~/.auphonic")))
  self.new(auphonic_credentials)
end

Instance Method Details

#production(uuid) ⇒ Object



14
15
16
# File 'lib/gst-kitchen/auphonic/account.rb', line 14

def production(uuid)
  Auphonic::Production.new(self, uuid)
end

#productionsObject



18
19
20
21
22
23
24
# File 'lib/gst-kitchen/auphonic/account.rb', line 18

def productions
  request("https://auphonic.com/api/productions.json")["data"].map do |meta|
    production = Auphonic::Production.new(self)
    production.meta = meta
    production
  end
end