jnunemaker/httparty — pull request #361 by rusikf (2014-12-19 13:26:40+00:00)
Title: add method_missing to HTTParty class

Tests are valid if you merge previous pr(rspec syntax error fix) https://github.com/jnunemaker/httparty/pull/360

So, what i do?
1)
```ruby
def self.get(*args, &block)
Basement.get(*args, &block)
end

def self.post(*args, &block)
Basement.post(*args, &block)
end

def self.patch(*args, &block)
Basement.patch(*args, &block)
end

def self.put(*args, &block)
Basement.put(*args, &block)
end

def self.delete(*args, &block)
Basement.delete(*args, &block)
end

def self.move(*args, &block)
Basement.move(*args, &block)
end

def self.copy(*args, &block)
Basement.copy(*args, &block)
end

def self.head(*args, &block)
Basement.head(*args, &block)
end

def self.options(*args, &block)
Basement.options(*args, &block)
end
```
This code in [lib/httparty.rb](https://github.com/jnunemaker/httparty/blob/master/lib/httparty.rb#L562) looks repeatable, i think it will be nice to have more light dynamic behaviour:
```ruby
class << self
def method_missing(name, *args, &block)
if Basement.respond_to?(name)
Basement.send(name, *args, &block)
else
super
end
end
end
```
2) There are two methods in HTTParty class: ```self.normalize_base_uri``` and ```self.included```, so i moved it without self to ```class << self``` above
3)
```ruby
class Basement #:nodoc:
include HTTParty
end
```
Move this after ```class << self``` ( because ```def included``` above must be declared before it is really included in Basement)