Class: Auphonic::Account
- Inherits:
-
Object
- Object
- Auphonic::Account
- Defined in:
- lib/gst-kitchen/auphonic/account.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Account
constructor
A new instance of Account.
- #production(uuid) ⇒ Object
- #productions ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Account
Returns a new instance of Account.
24 25 26 27 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 24 def initialize(={}) @username = ["user"] @password = ["pass"] end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
2 3 4 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 2 def password @password end |
#username ⇒ Object (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_system ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 5 def init_from_system auphonic_credentials = if File.exist?(local_config) Yajl::Parser.parse File.read(local_config) else Yajl::Parser.parse File.read(user_config) end self.new(auphonic_credentials) end |
.local_config ⇒ Object
19 20 21 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 19 def local_config File.join(Dir.getwd, '.auphonic') end |
.user_config ⇒ Object
15 16 17 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 15 def user_config File.("~/.auphonic") end |
Instance Method Details
#production(uuid) ⇒ Object
29 30 31 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 29 def production(uuid) Auphonic::Production.new(self, uuid) end |
#productions ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/gst-kitchen/auphonic/account.rb', line 33 def productions request("https://auphonic.com/api/productions.json")["data"].map do || production = Auphonic::Production.new(self) production. = production end end |