Module: MoySklad::Client::MissingAttrHandler

Defined in:
lib/moy_sklad/client/attribute.rb

Overview

Include in baseclass because we need this in ALL subclasses (also in autocreated by AR)

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/moy_sklad/client/attribute.rb', line 25

def method_missing(meth, *args)
  if meth[-1] != '='
    begin
      super
    rescue
      MoySklad::Client::Attribute::MissingAttr.new
    end
  else
    super
  end
end