Class: Gowalla::Stamp

Inherits:
Base
  • Object
show all
Defined in:
lib/gowalla/stamp.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Stamp

Returns a new instance of Stamp.



5
6
7
8
9
10
# File 'lib/gowalla/stamp.rb', line 5

def initialize(data={})
  @spot = Spot.new(data['spot'])
  @checkins_count = data['checkins_count']
  @first_checkin_at = DateTime.parse(data['first_checkin_at'])
  @last_checkin_at = DateTime.parse(data['last_checkin_at'])
end

Instance Attribute Details

#checkins_countObject

Returns the value of attribute checkins_count.



3
4
5
# File 'lib/gowalla/stamp.rb', line 3

def checkins_count
  @checkins_count
end

#first_checkin_atObject

Returns the value of attribute first_checkin_at.



3
4
5
# File 'lib/gowalla/stamp.rb', line 3

def first_checkin_at
  @first_checkin_at
end

#last_checkin_atObject

Returns the value of attribute last_checkin_at.



3
4
5
# File 'lib/gowalla/stamp.rb', line 3

def last_checkin_at
  @last_checkin_at
end

#spotObject

Returns the value of attribute spot.



3
4
5
# File 'lib/gowalla/stamp.rb', line 3

def spot
  @spot
end

Class Method Details

.find(username) ⇒ Object



11
12
13
# File 'lib/gowalla/stamp.rb', line 11

def self.find(username)
  self.fetch(username)["stamps"].map{|stamp| Stamp.new(stamp)}
end