Class: Chespirito::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/chespirito/routes/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*attrs) ⇒ Route

Returns a new instance of Route.



7
8
9
10
# File 'lib/chespirito/routes/route.rb', line 7

def initialize(*attrs)
  @verb, @path, @trait = attrs
  @controller_klass, @action = @trait
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



5
6
7
# File 'lib/chespirito/routes/route.rb', line 5

def action
  @action
end

#controller_klassObject (readonly)

Returns the value of attribute controller_klass.



5
6
7
# File 'lib/chespirito/routes/route.rb', line 5

def controller_klass
  @controller_klass
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/chespirito/routes/route.rb', line 5

def path
  @path
end

#verbObject (readonly)

Returns the value of attribute verb.



5
6
7
# File 'lib/chespirito/routes/route.rb', line 5

def verb
  @verb
end

Instance Method Details

#keyObject



12
# File 'lib/chespirito/routes/route.rb', line 12

def key = "#{@verb} #{@path}"