Class: CanTango::Finder::Base

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

Direct Known Subclasses

Permit::Base

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options) ⇒ Base

Returns a new instance of Base.

Raises:

  • (ArgumentError)


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

def initialize name, options
  @name = name.to_s.underscore.to_sym 
  @type = options[:type]
  raise ArgumentError, "Missing name of permit to find" if !name
  raise ArgumentError, "Missing type of permit to find" if !type
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/cantango/permits_ext/finder/base.rb', line 6

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/cantango/permits_ext/finder/base.rb', line 6

def type
  @type
end

Instance Method Details

#permitObject



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

def permit
  debug permit_msg(found_permit)
  found_permit
end