Class: Metaforce::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/metaforce/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



3
4
5
# File 'lib/metaforce/client.rb', line 3

def initialize(options = {})
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/metaforce/client.rb', line 21

def method_missing(method, *args, &block)
  if .respond_to? method, false
    .send(method, *args, &block)
  elsif services.respond_to? method, false
    services.send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/metaforce/client.rb', line 17

def inspect
  "#<#{self.class} @options=#{@options.inspect}>"
end

#metadataObject

Public: Used to interact with the Metadata API.



8
9
10
# File 'lib/metaforce/client.rb', line 8

def 
  @metadata ||= Metaforce::Metadata::Client.new(@options)
end

#servicesObject

Public: Used to interact with the Services API.



13
14
15
# File 'lib/metaforce/client.rb', line 13

def services
  @services ||= Metaforce::Services::Client.new(@options)
end