Class: Coffee::Config
- Inherits:
-
Object
- Object
- Coffee::Config
- Defined in:
- lib/coffee/config.rb
Class Method Summary collapse
Class Method Details
.basic ⇒ Object
8 9 10 |
# File 'lib/coffee/config.rb', line 8 def self.basic {:username => get("login"), :password => get("password") } end |
.get(key) ⇒ Object
4 5 6 |
# File 'lib/coffee/config.rb', line 4 def self.get(key) self.shared[key] end |
.path ⇒ Object
20 21 22 |
# File 'lib/coffee/config.rb', line 20 def self.path File.join(File.(Dir.home), ".coffee") end |
.shared ⇒ Object
16 17 18 |
# File 'lib/coffee/config.rb', line 16 def self.shared @shared ||= YAML::load(File.open(self.path)) end |
.url(path) ⇒ Object
12 13 14 |
# File 'lib/coffee/config.rb', line 12 def self.url(path) File.join(get("host"), path) end |