class Crossroads::Miss

Public Class Methods

new(attributes = {}, component: nil, render: nil, &block) click to toggle source
# File lib/crossroads/miss.rb, line 5
def initialize(attributes = {}, component: nil, render: nil, &block)
  @attributes = attributes
  # @attributes[:key] ||= 'miss'
  @render = -> { component.new } if component
  @render = render if render
  @render = block if block
end

Public Instance Methods

render() click to toggle source
# File lib/crossroads/miss.rb, line 13
def render
  div(@attributes, [@render.call()]) if !Router.matched.last
end