Class: LinkedRails::Collection::FilterField
- Inherits:
-
RDF::Node
- Object
- RDF::Node
- LinkedRails::Collection::FilterField
- Includes:
- ActiveModel::Model, ActiveModel::Serialization, LinkedRails::CallableVariable, Model
- Defined in:
- app/models/linked_rails/collection/filter_field.rb
Constant Summary
Constants included from Model::Collections
Model::Collections::COLLECTION_CUSTOMIZABLE_OPTIONS, Model::Collections::COLLECTION_OPTIONS, Model::Collections::COLLECTION_STATIC_OPTIONS
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#key ⇒ Object
Returns the value of attribute key.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#options_array ⇒ Object
writeonly
Sets the attribute options_array.
-
#options_in ⇒ Object
writeonly
Sets the attribute options_in.
Instance Method Summary collapse
Methods included from Model
Methods included from Model::Singularable
#root_relative_iri, #root_relative_singular_iri, #singular_iri, #singular_iri_opts, #singular_iri_template, #singular_resource?
Methods included from Model::Serialization
#preview_includes, #show_includes
Methods included from Model::Menuable
Methods included from Model::Iri
#anonymous_iri, #anonymous_iri?, #iri_elements, #iri_opts, #rdf_type, #reload, #root_relative_iri, #route_fragment
Methods included from Model::Enhancements
Methods included from Model::Dirty
#previous_changes_by_predicate, #previously_changed_relations
Methods included from Model::Collections
#collection_for, #collection_iri, #collection_options_for, #collection_root_relative_iri, #parent_collections
Methods included from Model::Actionable
#action, #action_list, #action_triples, #actions, #collection_actions, #favorite_actions
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection.
11 12 13 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 11 def collection @collection end |
#key ⇒ Object
Returns the value of attribute key.
11 12 13 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 11 def key @key end |
#klass ⇒ Object
Returns the value of attribute klass.
11 12 13 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 11 def klass @klass end |
#options_array=(value) ⇒ Object (writeonly)
Sets the attribute options_array
12 13 14 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 12 def (value) @options_array = value end |
#options_in=(value) ⇒ Object (writeonly)
Sets the attribute options_in
12 13 14 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 12 def (value) @options_in = value end |
Instance Method Details
#filter_option(option) ⇒ Object
24 25 26 27 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 24 def filter_option(option) attrs = option.is_a?(Hash) ? option : {value: option} Collection::FilterOption.new(attrs.merge(collection: collection, key: key)) end |
#iri(**_opts) ⇒ Object
16 17 18 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 16 def iri(**_opts) self end |
#options ⇒ Object
20 21 22 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 20 def @options ||= &.map(&method(:filter_option)) || [] end |
#serializable? ⇒ Boolean
29 30 31 |
# File 'app/models/linked_rails/collection/filter_field.rb', line 29 def serializable? || end |