Module: Alephant::Publisher::Views::Base::InstanceMethods
- Defined in:
- lib/alephant/publisher/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.
14 15 16 |
# File 'lib/alephant/publisher/views/base.rb', line 14 def base_path @base_path end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
14 15 16 |
# File 'lib/alephant/publisher/views/base.rb', line 14 def content_type @content_type end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
14 15 16 |
# File 'lib/alephant/publisher/views/base.rb', line 14 def data @data end |
Instance Method Details
#initialize(data = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/alephant/publisher/views/base.rb', line 16 def initialize(data = {}) @data = Hashie::Mash.new data @base_path = self.class.base_path setup end |
#setup ⇒ Object
27 |
# File 'lib/alephant/publisher/views/base.rb', line 27 def setup; end |
#to_h ⇒ Object
23 24 25 |
# File 'lib/alephant/publisher/views/base.rb', line 23 def to_h whitelist.reduce({}) { |m,s| m.tap { |m| m[s] = self.send(s) } } end |
#whitelist ⇒ Object
28 |
# File 'lib/alephant/publisher/views/base.rb', line 28 def whitelist; [] end |