Class: Clearwater::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/clearwater/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Application

Returns a new instance of Application.



5
6
7
8
9
10
# File 'lib/clearwater/application.rb', line 5

def initialize options={}
  @router = options.fetch(:router) { Router.new }
  @component = options.fetch(:component) { nil }
  router.application = self
  component.router = router
end

Instance Attribute Details

#componentObject (readonly)

Returns the value of attribute component.



3
4
5
# File 'lib/clearwater/application.rb', line 3

def component
  @component
end

#routerObject (readonly)

Returns the value of attribute router.



3
4
5
# File 'lib/clearwater/application.rb', line 3

def router
  @router
end

Instance Method Details

#renderObject



12
13
14
15
# File 'lib/clearwater/application.rb', line 12

def render
  router.set_outlets
  component.to_s
end