Class: Presentation::FieldSearch
- Defined in:
- lib/presentation/field_search.rb
Defined Under Namespace
Classes: Field
Instance Attribute Summary collapse
Attributes inherited from Base
Instance Method Summary collapse
- #fields ⇒ Object
-
#fields=(args) ⇒ Object
This method supports the configuration-on-initialization paradigm.
Methods inherited from Search
Methods inherited from Base
Methods included from Presenting::Configurable
Instance Attribute Details
#compact ⇒ Object
28 29 30 |
# File 'lib/presentation/field_search.rb', line 28 def compact @compact != false end |
Instance Method Details
#fields ⇒ Object
24 25 26 |
# File 'lib/presentation/field_search.rb', line 24 def fields @fields ||= Presenting::FieldSet.new(Field, :param, :type) end |
#fields=(args) ⇒ Object
This method supports the configuration-on-initialization paradigm. It makes:
present = Presentation::FieldSearch.new(:fields => [
{:a => {:type => :list, :options => %w(foo bar baz)}},
:b,
{:c => :boolean}
])
equivalent to:
present = Presentation::FieldSearch.new
present.fields << {:a => {:type => :list, :options => %w(foo bar baz)}}
present.fields << :b
present.fields << {:c => :boolean}
18 19 20 21 22 |
# File 'lib/presentation/field_search.rb', line 18 def fields=(args) args.each do |field| self.fields << field end end |