Class: Tabulatr::Renderer::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/tabulatr/renderer/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, partial: nil, &block) ⇒ Filter

Returns a new instance of Filter.



5
6
7
8
9
# File 'lib/tabulatr/renderer/filter.rb', line 5

def initialize(name, partial: nil, &block)
  @name = name
  @block = block
  @partial = partial
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



3
4
5
# File 'lib/tabulatr/renderer/filter.rb', line 3

def block
  @block
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/tabulatr/renderer/filter.rb', line 3

def name
  @name
end

#partialObject

Returns the value of attribute partial.



3
4
5
# File 'lib/tabulatr/renderer/filter.rb', line 3

def partial
  @partial
end

Instance Method Details

#filterObject



11
12
13
# File 'lib/tabulatr/renderer/filter.rb', line 11

def filter
  :custom
end

#to_partial_pathObject



15
16
17
18
19
20
21
# File 'lib/tabulatr/renderer/filter.rb', line 15

def to_partial_path
  if partial.present?
    partial
  else
    "tabulatr/filter/#{name.to_s.downcase.underscore}"
  end
end