Class: Hobber::RenderedObject

Inherits:
Object
  • Object
show all
Defined in:
lib/hobber/rendered_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ RenderedObject

Returns a new instance of RenderedObject.



5
6
7
8
9
10
11
# File 'lib/hobber/rendered_object.rb', line 5

def initialize opts={}
  @data = opts.fetch(:data)
  @renderable_object = opts.fetch(:renderable_object)
  @path = opts.fetch(:path)
  @layouts = opts.fetch(:layouts)
  @url = opts.fetch(:url)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/hobber/rendered_object.rb', line 3

def data
  @data
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/hobber/rendered_object.rb', line 3

def path
  @path
end

#renderable_objectObject (readonly)

Returns the value of attribute renderable_object.



3
4
5
# File 'lib/hobber/rendered_object.rb', line 3

def renderable_object
  @renderable_object
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/hobber/rendered_object.rb', line 3

def url
  @url
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/hobber/rendered_object.rb', line 13

def [](key)
  @renderable_object.tmpl_vars.fetch(key)
end