Class: CanTango::Finder::Permit::Base

Inherits:
Base
  • Object
show all
Includes:
Helpers::Debug
Defined in:
lib/cantango/permits_ext/finder/permit/base.rb

Direct Known Subclasses

Account

Instance Attribute Summary collapse

Attributes inherited from Base

#name, #type

Instance Method Summary collapse

Methods inherited from Base

#permit

Constructor Details

#initialize(name, options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'lib/cantango/permits_ext/finder/permit/base.rb', line 10

def initialize name, options = {}
  super
  @account = options[:account]
end

Instance Attribute Details

#accountObject (readonly)

This class is used to find the right permit, possible scoped for a specific user account



8
9
10
# File 'lib/cantango/permits_ext/finder/permit/base.rb', line 8

def 
  @account
end

Instance Method Details

#account_finder(name) ⇒ Object



20
21
22
# File 'lib/cantango/permits_ext/finder/permit/base.rb', line 20

def  name
  @account_finder ||= CanTango::Finder::Permit::Account.new name, :type => type, :account => 
end

#find_permitObject



15
16
17
18
# File 'lib/cantango/permits_ext/finder/permit/base.rb', line 15

def find_permit
  raise find_error if !retrieve_permit
  retrieve_permit
end