Class: Gambiarra::Route

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, to:, with: {}) ⇒ Route

Returns a new instance of Route.



6
7
8
9
10
# File 'lib/gambiarra/route.rb', line 6

def initialize(path, to:, with: {})
  @path   = path
  @view   = to
  @params = with
end

Instance Attribute Details

#lastObject (readonly)

Returns the value of attribute last.



3
4
5
# File 'lib/gambiarra/route.rb', line 3

def last
  @last
end

#paramsObject

Returns the value of attribute params.



4
5
6
# File 'lib/gambiarra/route.rb', line 4

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/gambiarra/route.rb', line 3

def path
  @path
end

#viewObject (readonly)

Returns the value of attribute view.



3
4
5
# File 'lib/gambiarra/route.rb', line 3

def view
  @view
end

Instance Method Details

#respond(**other_params) ⇒ Object



12
13
14
# File 'lib/gambiarra/route.rb', line 12

def respond(**other_params)
  view.respond(**params, **other_params)
end