Method: One9::Method#initialize

Defined in:
lib/one9/method.rb

#initialize(name, options = {}) ⇒ Method

Returns a new instance of Method.



17
18
19
20
21
22
23
24
25
# File 'lib/one9/method.rb', line 17

def initialize(name, options={})
  @name = name.to_s[/[.#]/] ? name :
    options[:class] ? options[:class] + name :
    raise(ArgumentError, "Method '#{name}' has an invalid name")
  @klass, @meth = @name.split(/[.#]/, 2)
  @message, @type = options.values_at(:message, :type)
  @message ||= @type == :delete ? "This method does not exist in 1.9" :
    "This method has different behavior in 1.9"
end