Method: MARCSpec::CustomSolrSpec#mod

Defined in:
lib/marcspec/dsl.rb

#mod(constant) ⇒ Object



146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/marcspec/dsl.rb', line 146

def mod(constant)
  # Is the module loaded?
  
  unless defined? constant
    raise ArgumentError, "Module #{constant} unknown; do you need to make sure it gets loaded?"
  end
  
  # Check to see if the functionSymbol exists
  unless constant.singleton_methods.include? self.functionSymbol.to_s
    raise ArgumentError, "Function #{self.functionSymbol} not defined in module #{constant}"
  end
  
  self.module = constant
end