Module: Magpie::Mouse::ClassMethods

Defined in:
lib/magpie/mouse.rb

Instance Method Summary collapse

Instance Method Details

#accountsObject

Raises:



21
22
23
24
25
# File 'lib/magpie/mouse.rb', line 21

def accounts
  @accounts ||= @accounts_env == 'test' ?  YAML.load_file('test/partner.yml')[@kind] : Magpie.yml_db[@kind]
  raise MouseError.new("#{@kind}商号配置出错,请检查#{@kind}的商号是否配置正确") if @accounts.nil?
  @accounts
end

#set_accounts_kind(kind, options = { }) ⇒ Object



16
17
18
19
# File 'lib/magpie/mouse.rb', line 16

def set_accounts_kind(kind, options={ })
  @kind = kind.to_s
  @accounts_env = options[:env] || "development"
end