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
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
#build_child, #singular_resource?
Methods included from Model::Serialization
#preview_includes, #show_includes
Methods included from Model::Iri
#anonymous_iri, #anonymous_iri?, #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, #parent_collections
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) = 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) = 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 ||= &.map(&method(:filter_option)) || [] end |