Class: Senju::Credentials
- Inherits:
-
Object
- Object
- Senju::Credentials
- Defined in:
- lib/senju/credentials.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #[](conf) ⇒ Object
-
#initialize(filepath = nil) ⇒ Credentials
constructor
A new instance of Credentials.
Constructor Details
#initialize(filepath = nil) ⇒ Credentials
Returns a new instance of Credentials.
4 5 6 7 |
# File 'lib/senju/credentials.rb', line 4 def initialize(filepath = nil) filepath ||= Dir.home + '/.senju/credentials' @data = YAML.load_file(filepath) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/senju/credentials.rb', line 3 def data @data end |
Instance Method Details
#[](conf) ⇒ Object
9 10 11 |
# File 'lib/senju/credentials.rb', line 9 def [](conf) @data[conf] end |