Class: Coffee::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/coffee/config.rb

Class Method Summary collapse

Class Method Details

.basicObject



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

.pathObject



20
21
22
# File 'lib/coffee/config.rb', line 20

def self.path
  File.join(File.expand_path(Dir.home), ".coffee")
end

.sharedObject



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