Class: ActiveFedora::Indexing::Map::IndexObject

Inherits:
Object
  • Object
show all
Defined in:
lib/active_fedora/indexing/map.rb

Overview

this enables a cleaner API for solr integration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ IndexObject

Returns a new instance of IndexObject.

Yields:

  • (_self)

Yield Parameters:



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

#behaviorsObject

Returns the value of attribute behaviors.



19
20
21
# File 'lib/active_fedora/indexing/map.rb', line 19

def behaviors
  @behaviors
end

#data_typeObject

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

#defaultsObject



41
42
43
# File 'lib/active_fedora/indexing/map.rb', line 41

def defaults
  :noop
end

#dupObject



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