Class: Spektr::Targets::Routes

Inherits:
Base
  • Object
show all
Defined in:
lib/spektr/targets/routes.rb

Defined Under Namespace

Classes: Action

Instance Attribute Summary collapse

Attributes inherited from Base

#ast, #name, #options, #parent, #path, #processor

Instance Method Summary collapse

Methods inherited from Base

#ast_to_exp, #find, #find_calls, #find_calls_with_block, #find_method, #find_methods, #find_xstr, #node_matches?

Constructor Details

#initialize(path, content) ⇒ Routes

Returns a new instance of Routes.



6
7
8
# File 'lib/spektr/targets/routes.rb', line 6

def initialize(path, content)
  super
end

Instance Attribute Details

#routesObject

Returns the value of attribute routes.



4
5
6
# File 'lib/spektr/targets/routes.rb', line 4

def routes
  @routes
end

Instance Method Details

#find_actionsObject



10
11
12
13
14
# File 'lib/spektr/targets/routes.rb', line 10

def find_actions
  @actions = find_methods(ast: @ast, type: :public ).map do |ast|
    Action.new(ast, self)
  end
end