class ActiveFedora::Indexing::Map::IndexObject

this enables a cleaner API for solr integration

Attributes

behaviors[RW]
data_type[RW]
key[R]
term[RW]

Public Class Methods

new(name, behaviors: []) { |self| ... } click to toggle source
# File lib/active_fedora/indexing/map.rb, line 30
def initialize(name, behaviors: [], &_block)
  @behaviors = behaviors
  @data_type = :string
  @key = name
  yield self if block_given?
end

Public Instance Methods

as(*args) click to toggle source
# File lib/active_fedora/indexing/map.rb, line 37
def as(*args)
  @term = args.last.is_a?(Hash) ? args.pop : {}
  @behaviors = args
end
dup() click to toggle source
# File lib/active_fedora/indexing/map.rb, line 46
def dup
  self.class.new(@key) do |idx|
    idx.behaviors = @behaviors.dup
  end
end
type(sym) click to toggle source
# File lib/active_fedora/indexing/map.rb, line 42
def type(sym)
  @data_type = sym
end