Class: BaseEditingBootstrap::Searches::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/base_editing_bootstrap/searches/field.rb

Overview

PORO per gestione del singolo campo

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(search_base, name) ⇒ Field

Returns a new instance of Field.

Parameters:



11
12
13
14
# File 'lib/base_editing_bootstrap/searches/field.rb', line 11

def initialize(search_base, name)
  @search_base = search_base
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/base_editing_bootstrap/searches/field.rb', line 7

def name
  @name
end

#search_baseObject (readonly)

Returns the value of attribute search_base.



7
8
9
# File 'lib/base_editing_bootstrap/searches/field.rb', line 7

def search_base
  @search_base
end

Instance Method Details

#labelString

Helper per estrapolare la label del campo

Returns:

  • (String)


23
24
25
# File 'lib/base_editing_bootstrap/searches/field.rb', line 23

def label
  @search_base.ransack_query.translate(name)
end

#to_partial_pathObject



16
17
18
# File 'lib/base_editing_bootstrap/searches/field.rb', line 16

def to_partial_path
  "search_field"
end