Class: HasHelpers::Resource::CellPresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/has_helpers/resource/cell_presenter.rb

Instance Attribute Summary collapse

Attributes inherited from BasePresenter

#errors, #wrapped_object

Instance Method Summary collapse

Methods inherited from BasePresenter

#==, #error_on, #initialize, wrap, wrap_with_options

Methods included from Attributes

included

Constructor Details

This class inherits a constructor from HasHelpers::BasePresenter

Dynamic Method Handling

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

Instance Attribute Details

#blankObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def blank
  @blank
end

#colspanObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def colspan
  @colspan
end

#current_user=(value) ⇒ Object (writeonly)

Setting template will cause rendering to use a custom partial



20
21
22
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 20

def current_user=(value)
  @current_user = value
end

#is_headerObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def is_header
  @is_header
end

#is_primaryObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def is_primary
  @is_primary
end

#is_service_externalObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def is_service_external
  @is_service_external
end

#is_textObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def is_text
  @is_text
end

#primary_titleObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def primary_title
  @primary_title
end

#resource=(value) ⇒ Object

Content attributes value, resource and tags. These attributes should be used exclusively.



5
6
7
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 5

def resource=(value)
  @resource = value
end

#serviceObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def service
  @service
end

#service_titleObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def service_title
  @service_title
end

#tagsObject

tags will generate an unordered list using the collection it is set to.



7
8
9
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 7

def tags
  @tags
end

#templateObject



32
33
34
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 32

def template
  @template.nil? ? detect_template_from_value : @template
end

#value=(value) ⇒ Object (writeonly)

Content attributes value, resource and tags. These attributes should be used exclusively.



5
6
7
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 5

def value=(value)
  @value = value
end

#warningObject

When set to true no output is generated for the content of the current cell. Without this option



9
10
11
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 9

def warning
  @warning
end

Instance Method Details

#contentObject

Returns the content from either value or resource.



24
25
26
27
28
29
30
# File 'app/presenters/has_helpers/resource/cell_presenter.rb', line 24

def content
  if @value.nil?
    resource
  elsif @value.present?
    @value
  end
end