Class: Boar::Handlers::Root
- Defined in:
- app/models/boar/handlers/root.rb
Instance Attribute Summary collapse
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Attributes inherited from Generic
Instance Method Summary collapse
- #call(*_) ⇒ Object
-
#initialize(service, options) ⇒ Root
constructor
A new instance of Root.
Methods included from Utils::Basic
#ensure_hash, #get_option, #interpolate
Constructor Details
#initialize(service, options) ⇒ Root
Returns a new instance of Root.
12 13 14 15 16 17 |
# File 'app/models/boar/handlers/root.rb', line 12 def initialize(service, ) super(service) # Get the template for building the root @template = self.get_option(, :directory, @configuration.directory) end |
Instance Attribute Details
#template ⇒ Object (readonly)
Returns the value of attribute template.
10 11 12 |
# File 'app/models/boar/handlers/root.rb', line 10 def template @template end |
Instance Method Details
#call(*_) ⇒ Object
19 20 21 22 |
# File 'app/models/boar/handlers/root.rb', line 19 def call(*_) # Interpolate to a directory Pathname.new(self.interpolate(@template, {root: Rails.root, request: @service.controller.request, controller: @service.controller})) end |