Class: Pieces::RouteCompiler::ViewModel
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Pieces::RouteCompiler::ViewModel
- Defined in:
- lib/pieces/route_compiler.rb
Instance Attribute Summary collapse
-
#asset_prefix ⇒ Object
Returns the value of attribute asset_prefix.
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
- #compute_asset_path(path, options = {}) ⇒ Object
-
#initialize ⇒ ViewModel
constructor
A new instance of ViewModel.
Constructor Details
#initialize ⇒ ViewModel
Returns a new instance of ViewModel.
59 60 61 62 |
# File 'lib/pieces/route_compiler.rb', line 59 def initialize(*) super _prepare_context if respond_to?(:_prepare_context) end |
Instance Attribute Details
#asset_prefix ⇒ Object
Returns the value of attribute asset_prefix.
50 51 52 |
# File 'lib/pieces/route_compiler.rb', line 50 def asset_prefix @asset_prefix end |
#env ⇒ Object
Returns the value of attribute env.
49 50 51 |
# File 'lib/pieces/route_compiler.rb', line 49 def env @env end |
Instance Method Details
#compute_asset_path(path, options = {}) ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/pieces/route_compiler.rb', line 64 def compute_asset_path(path, = {}) if env.resolve!(path) File.join(asset_prefix || '/assets', path) else super end end |