Class: Pv::Configuration

Inherits:
Object show all
Defined in:
lib/pv/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/pv/configuration.rb', line 5

def attributes
  @attributes
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/pv/configuration.rb', line 5

def name
  @name
end

#passwordObject (readonly)

Returns the value of attribute password.



5
6
7
# File 'lib/pv/configuration.rb', line 5

def password
  @password
end

#project_idObject (readonly)

Returns the value of attribute project_id.



5
6
7
# File 'lib/pv/configuration.rb', line 5

def project_id
  @project_id
end

#usernameObject (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

Returns:

  • (Boolean)


15
16
17
# File 'lib/pv/configuration.rb', line 15

def present?
  File.exists? from_path
end