Class: Posterrrrous
Class Attribute Summary collapse
-
.email ⇒ Object
Returns the value of attribute email.
-
.password ⇒ Object
Returns the value of attribute password.
Class Method Summary collapse
Class Attribute Details
.email ⇒ Object
Returns the value of attribute email.
10 11 12 |
# File 'lib/posterrrrous.rb', line 10 def email @email end |
.password ⇒ Object
Returns the value of attribute password.
10 11 12 |
# File 'lib/posterrrrous.rb', line 10 def password @password end |
Class Method Details
.method_missing(method_sym, *arguments, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/posterrrrous.rb', line 13 def self.method_missing(method_sym, *arguments, &block) attributes = arguments.pop = { :query => attributes, :basic_auth => { :username => email, :password => password } } response = get "/#{method_sym}", response = response["rsp"] status = response.delete('stat') if status != "ok" error = response['err'] raise "Posterous Error #{error['code']}: #{error['msg']}" else response.values.first end end |