Class: Hobber::RenderedObject
- Inherits:
-
Object
- Object
- Hobber::RenderedObject
- Defined in:
- lib/hobber/rendered_object.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#renderable_object ⇒ Object
readonly
Returns the value of attribute renderable_object.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(opts = {}) ⇒ RenderedObject
constructor
A new instance of RenderedObject.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/hobber/rendered_object.rb', line 3 def data @data end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/hobber/rendered_object.rb', line 3 def path @path end |
#renderable_object ⇒ Object (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 |
#url ⇒ Object (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 |