Class: Twitterland::Cadmus

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/twitterland/cadmus.rb

Class Method Summary collapse

Class Method Details

.handle_response(response) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/twitterland/cadmus.rb', line 13

def self.handle_response(response)
  case response.code.to_i
  when 401
    raise Twitterland::Unauthorized.new(response.body)
  when 500
    raise Twitterland::General.new(response.body)
  end
end

.posts(options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/twitterland/cadmus.rb', line 7

def self.posts(options={})
  response = get("/posts", :query => options)
  handle_response(response)
  response.map{|p| Hashie::Mash.new(p)}
end