module Snap

Constants

VERSION

Attributes

api_key[RW]

Public Class Methods

configure(api_key, config_file=File.expand_path('~/.snap.yml')) click to toggle source
# File lib/snap.rb, line 9
def configure(api_key, config_file=File.expand_path('~/.snap.yml'))
  config = {
    :api_key => api_key
  }
  File.open(config_file, 'w') do |f|
    f.puts(config.to_yaml)
  end
end
init(config_file=File.expand_path('~/.snap.yml')) click to toggle source
# File lib/snap.rb, line 18
def init(config_file=File.expand_path('~/.snap.yml'))
  self.api_key = YAML.load_file(config_file)[:api_key]
end