Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (15 sloc) 0.366 kb
b92b0ca Erik Michaels-Ober Add User, Status, Place, Point, and Polygon classes
authored
1 module Twitter
2 class Base
1dd37f2 Erik Michaels-Ober Method spacing
authored
3
b92b0ca Erik Michaels-Ober Add User, Status, Place, Point, and Polygon classes
authored
4 def initialize(hash={})
5 hash.each do |key, value|
6 instance_variable_set(:"@#{key}", value) unless value.nil?
7 end
8 end
9
d63d2e5 Erik Michaels-Ober Allow [] access to methods for greater backwards compatibility
authored
10 def [](method)
11 self.__send__(method.to_sym)
12 end
13
cc1e2e4 Erik Michaels-Ober Add #user method to Status class
authored
14 def to_hash
15 Hash[instance_variables.map{|ivar| [ivar[1..-1].to_sym, instance_variable_get(ivar)]}]
16 end
1dd37f2 Erik Michaels-Ober Method spacing
authored
17
b92b0ca Erik Michaels-Ober Add User, Status, Place, Point, and Polygon classes
authored
18 end
19 end
Something went wrong with that request. Please try again.