Module: Alephant::Publisher::Views::Base::InstanceMethods

Defined in:
lib/alephant/publisher/views/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#base_pathObject (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_typeObject (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

#dataObject (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

#setupObject



27
# File 'lib/alephant/publisher/views/base.rb', line 27

def setup; end

#to_hObject



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

#whitelistObject



28
# File 'lib/alephant/publisher/views/base.rb', line 28

def whitelist; [] end