Module: Eastwood::Context
- Defined in:
- lib/eastwood.rb,
lib/eastwood/context.rb,
lib/eastwood/context/action_route.rb,
lib/eastwood/context/client_route.rb,
lib/eastwood/context/journey_route.rb,
lib/eastwood/context/route_helpers.rb
Defined Under Namespace
Modules: RouteHelpers
Classes: ActionRoute, ClientRoute, JourneyRoute
Instance Method Summary
collapse
Instance Method Details
#app ⇒ Object
4
5
6
|
# File 'lib/eastwood/context.rb', line 4
def app
Eastwood.javascript_namespace or Eastwood.application_name
end
|
#client_routes ⇒ Object
23
24
25
26
27
28
|
# File 'lib/eastwood/context.rb', line 23
def client_routes
custom_routes.merge( custom_routes ){ |key, (route, suffix)| ClientRoute.new key, route, suffix }
end
|
#env ⇒ Object
8
9
10
|
# File 'lib/eastwood/context.rb', line 8
def env
Eastwood.env
end
|
#exports ⇒ Object
30
31
32
|
# File 'lib/eastwood/context.rb', line 30
def exports
Eastwood.exports
end
|
34
35
36
|
# File 'lib/eastwood/context.rb', line 34
def route_format
omit_route_format? ? '' : ".#{Eastwood.default_route_format.to_s}"
end
|
#server_routes ⇒ Object
16
17
18
19
20
21
|
# File 'lib/eastwood/context.rb', line 16
def server_routes
named_routes.merge( named_routes ) { |key, route| route_class.new route, route_format }
end
|
#target ⇒ Object
12
13
14
|
# File 'lib/eastwood/context.rb', line 12
def target
env === 'test' ? '( @window ||= { } )' : 'window'
end
|