Class: Pv::Configuration
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #present? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 |
# File 'lib/pv/configuration.rb', line 7 def initialize @attributes = YAML::load_file from_path @username = @attributes['username'] @password = @attributes['password'] @project_id = @attributes['project_id'] @name = @attributes['name'] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/pv/configuration.rb', line 5 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/pv/configuration.rb', line 5 def name @name end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/pv/configuration.rb', line 5 def password @password end |
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
5 6 7 |
# File 'lib/pv/configuration.rb', line 5 def project_id @project_id end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/pv/configuration.rb', line 5 def username @username end |
Instance Method Details
#present? ⇒ Boolean
15 16 17 |
# File 'lib/pv/configuration.rb', line 15 def present? File.exists? from_path end |