Module: Magpie::Mouse

Included in:
AlipayModel, ChinabankModel, TenpayModel
Defined in:
lib/magpie/mouse.rb

Overview

获取一些持久化信息,主要是商户账号

Defined Under Namespace

Modules: ClassMethods Classes: MouseError

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(m) ⇒ Object



10
11
12
# File 'lib/magpie/mouse.rb', line 10

def self.included(m)
  m.extend ClassMethods
end

Instance Method Details

#accountObject



29
30
31
32
# File 'lib/magpie/mouse.rb', line 29

def 
  @account ||= self.class.accounts.assoc self.partner
  @account ||= []
end

#keyObject



34
35
36
# File 'lib/magpie/mouse.rb', line 34

def key
  @key ||= self.[1].to_s
end

#missing_partner?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/magpie/mouse.rb', line 38

def missing_partner?
  self. == [] ? true : false
end