Class: FreshBooks::Client::NamespaceProxy

Inherits:
Struct
  • Object
show all
Defined in:
lib/freshbooks.rb

Overview

nothing to see hereā€¦

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object



115
116
117
118
119
120
121
122
123
# File 'lib/freshbooks.rb', line 115

def method_missing(sym, *args)
  # check for subordinate resources
  if [:invoice, :recurring].include?(namespace) and
      sym == :lines
    NamespaceProxy.new client, "#{namespace}.#{sym}"
  else
    client.post "#{namespace}.#{sym}", *args
  end
end

Instance Attribute Details

#clientObject

Returns the value of attribute client

Returns:

  • (Object)

    the current value of client



114
115
116
# File 'lib/freshbooks.rb', line 114

def client
  @client
end

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



114
115
116
# File 'lib/freshbooks.rb', line 114

def namespace
  @namespace
end