Class: DrupalFu::Client

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

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(resource, args, &block) ⇒ Object



15
16
17
# File 'lib/drupal_fu/client.rb', line 15

def method_missing(resource, args, &block)
  DrupalObject.new(JSON.parse(RestClient.get("#{self.class.options[:base_uri]}/#{resource}/#{args}", {:accept => :json})))
end

Class Method Details

.optionsObject



8
9
10
11
12
# File 'lib/drupal_fu/client.rb', line 8

def options
  @options ||= {
    :base_uri => DRUPAL_BASE_URI # Class reloading in Rails Development Environment
  }
end