Class: ActiveFedora::Indexing::Map::IndexObject
- Inherits:
-
Object
- Object
- ActiveFedora::Indexing::Map::IndexObject
- Defined in:
- lib/active_fedora/indexing/map.rb
Overview
this enables a cleaner API for solr integration
Instance Attribute Summary collapse
-
#behaviors ⇒ Object
Returns the value of attribute behaviors.
-
#data_type ⇒ Object
Returns the value of attribute data_type.
Instance Method Summary collapse
- #as(*args) ⇒ Object
- #defaults ⇒ Object
- #dup ⇒ Object
-
#initialize {|_self| ... } ⇒ IndexObject
constructor
A new instance of IndexObject.
- #type(sym) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ IndexObject
Returns a new instance of IndexObject.
21 22 23 24 25 |
# File 'lib/active_fedora/indexing/map.rb', line 21 def initialize(&block) @behaviors = [] @data_type = :string yield self if block_given? end |
Instance Attribute Details
#behaviors ⇒ Object
Returns the value of attribute behaviors.
19 20 21 |
# File 'lib/active_fedora/indexing/map.rb', line 19 def behaviors @behaviors end |
#data_type ⇒ Object
Returns the value of attribute data_type.
19 20 21 |
# File 'lib/active_fedora/indexing/map.rb', line 19 def data_type @data_type end |
Instance Method Details
#as(*args) ⇒ Object
27 28 29 |
# File 'lib/active_fedora/indexing/map.rb', line 27 def as(*args) @behaviors = args end |
#defaults ⇒ Object
41 42 43 |
# File 'lib/active_fedora/indexing/map.rb', line 41 def defaults :noop end |
#dup ⇒ Object
35 36 37 38 39 |
# File 'lib/active_fedora/indexing/map.rb', line 35 def dup self.class.new do |idx| idx.behaviors = @behaviors.dup end end |
#type(sym) ⇒ Object
31 32 33 |
# File 'lib/active_fedora/indexing/map.rb', line 31 def type(sym) @data_type = sym end |