Class: Coltrane::UI::Router::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/coltrane/ui/router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Route.



8
9
10
11
12
# File 'lib/coltrane/ui/router.rb', line 8

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

Instance Attribute Details

#lastObject (readonly)

Returns the value of attribute last.



5
6
7
# File 'lib/coltrane/ui/router.rb', line 5

def last
  @last
end

#paramsObject

Returns the value of attribute params.



6
7
8
# File 'lib/coltrane/ui/router.rb', line 6

def params
  @params
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/coltrane/ui/router.rb', line 5

def path
  @path
end

#viewObject (readonly)

Returns the value of attribute view.



5
6
7
# File 'lib/coltrane/ui/router.rb', line 5

def view
  @view
end

Instance Method Details

#render(**other_params) ⇒ Object



14
15
16
# File 'lib/coltrane/ui/router.rb', line 14

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