Class: ActiveTriples::NodeConfig
- Inherits:
-
Object
- Object
- ActiveTriples::NodeConfig
- Defined in:
- lib/active_triples/node_config.rb
Defined Under Namespace
Classes: IndexObject
Instance Attribute Summary collapse
-
#behaviors ⇒ Object
Returns the value of attribute behaviors.
-
#cast ⇒ Object
Returns the value of attribute cast.
-
#class_name ⇒ Object
Returns the value of attribute class_name.
-
#predicate ⇒ Object
Returns the value of attribute predicate.
-
#term ⇒ Object
Returns the value of attribute term.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #[](value) ⇒ Object
-
#initialize(term, predicate, args = {}) {|_self| ... } ⇒ NodeConfig
constructor
A new instance of NodeConfig.
- #with_index {|iobj| ... } ⇒ Object
Constructor Details
#initialize(term, predicate, args = {}) {|_self| ... } ⇒ NodeConfig
Returns a new instance of NodeConfig.
5 6 7 8 9 10 11 |
# File 'lib/active_triples/node_config.rb', line 5 def initialize(term, predicate, args={}) self.term = term self.predicate = predicate self.class_name = args.fetch(:class_name) { default_class_name } self.cast = args.fetch(:cast) { true } yield(self) if block_given? end |
Instance Attribute Details
#behaviors ⇒ Object
Returns the value of attribute behaviors.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def behaviors @behaviors end |
#cast ⇒ Object
Returns the value of attribute cast.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def cast @cast end |
#class_name ⇒ Object
Returns the value of attribute class_name.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def class_name @class_name end |
#predicate ⇒ Object
Returns the value of attribute predicate.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def predicate @predicate end |
#term ⇒ Object
Returns the value of attribute term.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def term @term end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/active_triples/node_config.rb', line 3 def type @type end |
Instance Method Details
#[](value) ⇒ Object
13 14 15 16 |
# File 'lib/active_triples/node_config.rb', line 13 def [](value) value = value.to_sym self.respond_to?(value) ? self.send(value) : nil end |
#with_index {|iobj| ... } ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/active_triples/node_config.rb', line 31 def with_index (&block) # needed for solrizer integration iobj = IndexObject.new yield iobj self.type = iobj.data_type self.behaviors = iobj.behaviors end |