Class: PhoneGap::Build::Credentials
- Inherits:
-
Object
- Object
- PhoneGap::Build::Credentials
- Includes:
- Singleton
- Defined in:
- lib/phone_gap/build/credentials.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#token ⇒ Object
Returns the value of attribute token.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/phone_gap/build/credentials.rb', line 9 def config @config end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
9 10 11 |
# File 'lib/phone_gap/build/credentials.rb', line 9 def password @password end |
#token ⇒ Object
Returns the value of attribute token.
9 10 11 |
# File 'lib/phone_gap/build/credentials.rb', line 9 def token @token end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
9 10 11 |
# File 'lib/phone_gap/build/credentials.rb', line 9 def username @username end |
Instance Method Details
#load ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/phone_gap/build/credentials.rb', line 19 def load if config_file && File.exists?(config_file) @config = YAML::load(ERB.new(File.read(config_file)).result) @token = @config['token'] end self end |
#set(credentials) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/phone_gap/build/credentials.rb', line 12 def set(credentials) @username = credentials[:username] @password = credentials[:password] @token = credentials[:token] self end |