Class: LinkedRails::Widget
- Inherits:
-
Object
- Object
- LinkedRails::Widget
- Includes:
- ActiveModel::Model, Model
- Defined in:
- app/models/linked_rails/widget.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
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#resources ⇒ Object
writeonly
Sets the attribute resources.
- #size ⇒ Object
-
#topology ⇒ Object
Returns the value of attribute topology.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
Methods included from Model::Singularable
#root_relative_iri, #root_relative_singular_iri, #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
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
#parent ⇒ Object
Returns the value of attribute parent.
9 10 11 |
# File 'app/models/linked_rails/widget.rb', line 9 def parent @parent end |
#resources=(value) ⇒ Object (writeonly)
Sets the attribute resources
8 9 10 |
# File 'app/models/linked_rails/widget.rb', line 8 def resources=(value) @resources = value end |
#size ⇒ Object
27 28 29 |
# File 'app/models/linked_rails/widget.rb', line 27 def size @size || 1 end |
#topology ⇒ Object
Returns the value of attribute topology.
9 10 11 |
# File 'app/models/linked_rails/widget.rb', line 9 def topology @topology end |
Class Method Details
.iri ⇒ Object
43 44 45 |
# File 'app/models/linked_rails/widget.rb', line 43 def iri Vocab.ontola[:Widget] end |
Instance Method Details
#iri(**_opts) ⇒ Object
11 12 13 |
# File 'app/models/linked_rails/widget.rb', line 11 def iri(**_opts) @iri ||= RDF::Node.new end |
#property_shapes ⇒ Object
15 16 17 18 19 |
# File 'app/models/linked_rails/widget.rb', line 15 def property_shapes resource_sequence @property_shapes || {} end |
#resource_sequence ⇒ Object
21 22 23 24 25 |
# File 'app/models/linked_rails/widget.rb', line 21 def resource_sequence @resource_sequence ||= @resources.map do |iri, predicate| predicate.present? ? property_shape(iri, predicate) : RDF::URI(iri) end end |