Module: Alephant::Renderer::Views::Base::InstanceMethods
- Defined in:
- lib/alephant/renderer/views/base.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
Instance Attribute Details
#base_path ⇒ Object (readonly)
Returns the value of attribute base_path.
15 16 17 |
# File 'lib/alephant/renderer/views/base.rb', line 15 def base_path @base_path end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
15 16 17 |
# File 'lib/alephant/renderer/views/base.rb', line 15 def content_type @content_type end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
15 16 17 |
# File 'lib/alephant/renderer/views/base.rb', line 15 def data @data end |
Instance Method Details
#initialize(data = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/alephant/renderer/views/base.rb', line 17 def initialize(data = {}) @data = Hashie::Mash.new data @base_path = self.class.base_path setup end |
#setup ⇒ Object
30 |
# File 'lib/alephant/renderer/views/base.rb', line 30 def setup; end |
#to_h ⇒ Object
24 25 26 27 28 |
# File 'lib/alephant/renderer/views/base.rb', line 24 def to_h whitelist.reduce({}) do |accum, method_key| accum.tap { |a| a[method_key] = send(method_key) } end end |
#whitelist ⇒ Object
32 33 34 |
# File 'lib/alephant/renderer/views/base.rb', line 32 def whitelist [] end |