Class: LinkedRails::Widget

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Model

#build_child

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

#menu, #menu_list, #menus

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

#enhanced_with?

Methods included from Model::Dirty

#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

#parentObject

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

Parameters:

  • value

    the value to set the attribute resources to.



8
9
10
# File 'app/models/linked_rails/widget.rb', line 8

def resources=(value)
  @resources = value
end

#sizeObject



27
28
29
# File 'app/models/linked_rails/widget.rb', line 27

def size
  @size || 1
end

#topologyObject

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

.iriObject



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_shapesObject



15
16
17
18
19
# File 'app/models/linked_rails/widget.rb', line 15

def property_shapes
  resource_sequence

  @property_shapes || {}
end

#resource_sequenceObject



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