Class: TypeStation::ContentPresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/type_station/content_presenter.rb

Instance Method Summary collapse

Methods inherited from BasePresenter

#initialize

Constructor Details

This class inherits a constructor from TypeStation::BasePresenter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TypeStation::BasePresenter

Instance Method Details



10
11
12
13
# File 'app/presenters/type_station/content_presenter.rb', line 10

def link(default, html_options = nil, &block)
  css_class = html_options.delete(:class) if html_options.include?(:class)
  (:a, nil, html_options.merge({class: ['ts-editable-link-tag', css_class], href: link_href(default), data: link_data_attribute }), &block)
end

#tag(default, options = {}) ⇒ Object



5
6
7
8
# File 'app/presenters/type_station/content_presenter.rb', line 5

def tag(default, options = {})
  css_class = options.delete(:class) if options.include?(:class)
  cl_image_tag((content.present? ? content['identifier'] : default), options.merge({class: ['ts-editable-image-tag', css_class], data: options}))
end

#valueObject



19
20
21
# File 'app/presenters/type_station/content_presenter.rb', line 19

def value
  sanitized_value
end

#value_is_hash?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/presenters/type_station/content_presenter.rb', line 15

def value_is_hash?
  content.is_a? Hash
end