Class: Ddr::Models::MetadataVocabulary
- Inherits:
-
Object
- Object
- Ddr::Models::MetadataVocabulary
- Extended by:
- MetadataVocabularies
- Defined in:
- lib/ddr/models/metadata/metadata_vocabulary.rb
Instance Attribute Summary collapse
-
#except ⇒ Object
readonly
Returns the value of attribute except.
-
#only_properties ⇒ Object
readonly
Returns the value of attribute only_properties.
-
#rdf_vocab ⇒ Object
readonly
Returns the value of attribute rdf_vocab.
Instance Method Summary collapse
-
#initialize(rdf_vocab, except: nil, only_properties: true) ⇒ MetadataVocabulary
constructor
A new instance of MetadataVocabulary.
- #terms ⇒ Array<RDF::Vocabulary::Term>
Methods included from MetadataVocabularies
Constructor Details
#initialize(rdf_vocab, except: nil, only_properties: true) ⇒ MetadataVocabulary
Returns a new instance of MetadataVocabulary.
12 13 14 15 16 |
# File 'lib/ddr/models/metadata/metadata_vocabulary.rb', line 12 def initialize(rdf_vocab, except: nil, only_properties: true) @rdf_vocab = rdf_vocab @except = Array(except) @only_properties = only_properties end |
Instance Attribute Details
#except ⇒ Object (readonly)
Returns the value of attribute except.
5 6 7 |
# File 'lib/ddr/models/metadata/metadata_vocabulary.rb', line 5 def except @except end |
#only_properties ⇒ Object (readonly)
Returns the value of attribute only_properties.
5 6 7 |
# File 'lib/ddr/models/metadata/metadata_vocabulary.rb', line 5 def only_properties @only_properties end |
#rdf_vocab ⇒ Object (readonly)
Returns the value of attribute rdf_vocab.
5 6 7 |
# File 'lib/ddr/models/metadata/metadata_vocabulary.rb', line 5 def rdf_vocab @rdf_vocab end |
Instance Method Details
#terms ⇒ Array<RDF::Vocabulary::Term>
19 20 21 |
# File 'lib/ddr/models/metadata/metadata_vocabulary.rb', line 19 def terms @terms ||= rdf_properties.map { |term| MetadataTerm.new(term) } end |