Class: Funktional::RouteChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/funktional/route_checker.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ RouteChecker

Returns a new instance of RouteChecker.



17
18
19
20
# File 'lib/funktional/route_checker.rb', line 17

def initialize(params)
  @__path_and_method = __get_path_and_method(params)
  @__controller_action_etc = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, value) ⇒ Object



29
30
31
# File 'lib/funktional/route_checker.rb', line 29

def method_missing(method_name, value)
  @__controller_action_etc[method_name] = value
end

Instance Attribute Details

#__controller_action_etcObject (readonly)

Returns the value of attribute __controller_action_etc.



8
9
10
# File 'lib/funktional/route_checker.rb', line 8

def __controller_action_etc
  @__controller_action_etc
end

#__path_and_methodObject (readonly)

Returns the value of attribute __path_and_method.



8
9
10
# File 'lib/funktional/route_checker.rb', line 8

def __path_and_method
  @__path_and_method
end

Class Method Details

.build(params, &blk) ⇒ Object



10
11
12
13
14
15
# File 'lib/funktional/route_checker.rb', line 10

def self.build(params, &blk)
  checker = self.new(params)
  
  checker.instance_eval(&blk)
  return checker
end

Instance Method Details

#__test_nameObject



22
23
24
25
26
27
# File 'lib/funktional/route_checker.rb', line 22

def __test_name
  path = @__path_and_method[:path]
  method = @__path_and_method[:method]
  
  "route '#{path}' :method '#{method}' to #{@__controller_action_etc.inspect}"
end