class ActiveTriples::NodeConfig
Configuration
for properties
Attributes
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
@!attribute class_name
[rw]
@return [Class, String]
@!attribute predicate [rw]
@return [RDF::URI]
@!attribute term [rw]
@return [Symbol]
@!attribute type [rw]
@return [Symbol]
@!attribute behaviors [rw]
@return [Enumerator<Symbol>]
@!attribute cast [rw]
@return [Boolean]
Public Class Methods
@param term [Symbol] @param predicate [RDF::URI] @param opts [Hash<Symbol, Object>] @option opts [String, Class] :class_name @option opts [String, Class] :class_name
@yield yields self to the block @yieldparam config [NodeConfig] self
# File lib/active_triples/node_config.rb, line 31 def initialize(term, predicate, opts={}) self.term = term self.predicate = predicate self.class_name = opts.delete(:class_name) { nil } self.cast = opts.delete(:cast) { true } @opts = opts yield(self) if block_given? end
Public Instance Methods
@param value [#to_sym] @return [Object] the attribute or option represented by the symbol
# File lib/active_triples/node_config.rb, line 43 def [](value) value = value.to_sym self.respond_to?(value) ? self.public_send(value) : @opts[value] end
@yield yields an index configuration object @yieldparam index [NodeConfig::IndexObject]
# File lib/active_triples/node_config.rb, line 64 def with_index(&block) # needed for solrizer integration iobj = IndexObject.new yield iobj self.type = iobj.data_type self.behaviors = iobj.behaviors end
Private Instance Methods
@deprecated Use ‘nil` instead.
# File lib/active_triples/node_config.rb, line 76 def default_class_name warn 'DEPRECATION: `ActiveTriples::NodeConfig#default_class_name` ' \ 'will be removed in 1.0. Use `nil`.' nil end