Module: Tripod::EmbeddedResource
- Extended by:
- ActiveSupport::Concern
- Includes:
- ActiveModel::Validations, Attributes, Fields, Predicates, RdfType, Validations
- Defined in:
- lib/tripod/embedded_resource.rb
Instance Attribute Summary collapse
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
Methods included from RdfType
Methods included from Attributes
#read_attribute, #write_attribute
Methods included from Predicates
#append_to_predicate, #predicates, #read_predicate, #remove_predicate, #write_predicate
Instance Attribute Details
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
12 13 14 |
# File 'lib/tripod/embedded_resource.rb', line 12 def uri @uri end |
Instance Method Details
#==(resource) ⇒ Object
24 25 26 |
# File 'lib/tripod/embedded_resource.rb', line 24 def ==(resource) (@uri == resource.uri) end |
#initialize(opts = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/tripod/embedded_resource.rb', line 14 def initialize(opts={}) @uri = opts.fetch(:node, RDF::Node.new) # use a blank node for the URI @repository = opts.fetch(:repository, RDF::Repository.new) set_rdf_type end |
#to_statements ⇒ Object
20 21 22 |
# File 'lib/tripod/embedded_resource.rb', line 20 def to_statements @repository.statements end |