Class: Boar::Handlers::Views

Inherits:
Generic
  • Object
show all
Defined in:
app/models/boar/handlers/views.rb

Instance Attribute Summary collapse

Attributes inherited from Generic

#configuration, #service

Instance Method Summary collapse

Methods included from Utils::Basic

#ensure_hash, #get_option, #interpolate

Constructor Details

#initialize(service, options) ⇒ Views

Returns a new instance of Views.



12
13
14
15
16
17
# File 'app/models/boar/handlers/views.rb', line 12

def initialize(service, options)
  super(service)

  # Get the views
  @views = self.get_option(options, :views, @configuration.views)
end

Instance Attribute Details

#viewsObject (readonly)

Returns the value of attribute views.



10
11
12
# File 'app/models/boar/handlers/views.rb', line 10

def views
  @views
end

Instance Method Details

#call(*args) ⇒ Object



19
20
21
22
# File 'app/models/boar/handlers/views.rb', line 19

def call(*args)
  # Interpolate the template
  self.interpolate(@views.fetch(args[0]), ensure_hash(args[1]))
end