Class: Redde::IndexHelper::IndexBuilder

Inherits:
Object
  • Object
show all
Includes:
ActionView::Context, ActionView::Helpers::TagHelper
Defined in:
app/helpers/redde/index_helper.rb

Defined Under Namespace

Classes: IndexCellBuilder, IndexHeadCellBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list, params) ⇒ IndexBuilder

Returns a new instance of IndexBuilder.



145
146
147
148
# File 'app/helpers/redde/index_helper.rb', line 145

def initialize(list, params)
  @list = list
  @params = params
end

Instance Attribute Details

#listObject

Returns the value of attribute list.



143
144
145
# File 'app/helpers/redde/index_helper.rb', line 143

def list
  @list
end

#paramsObject

Returns the value of attribute params.



143
144
145
# File 'app/helpers/redde/index_helper.rb', line 143

def params
  @params
end

Instance Method Details

#empty(options = {}) ⇒ Object



150
151
152
# File 'app/helpers/redde/index_helper.rb', line 150

def empty( options = {} )
  (:th, "", class: ['list__head', options[:class]])
end

#thead(insert) ⇒ Object



154
155
156
157
158
# File 'app/helpers/redde/index_helper.rb', line 154

def thead insert
   :thead do
    (:tr, empty + visible + insert + empty(class: 'list__head_del') + empty)
  end
end

#visibleObject



160
161
162
# File 'app/helpers/redde/index_helper.rb', line 160

def visible
  empty(class: '_eye') if list.column_names.include?('visible')
end