Method: CoreLibrary::BaseModel#method_missing

Defined in:
lib/apimatic-core/types/sdk/base_model.rb

#method_missing(method_sym, *arguments, &block) ⇒ Object

Use to allow additional model properties.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/apimatic-core/types/sdk/base_model.rb', line 5

def method_missing(method_sym, *arguments, &block)
  method = method_sym.to_s
  if method.end_with? '='
    instance_variable_set(format('@%s', [method.chomp('=')]),
                          arguments.first)
  elsif instance_variable_defined?("@#{method}") && arguments.empty?
    instance_variable_get("@#{method}")
  else
    super
  end
end