class Petli::Poop

Constants

ANIMATION
LOCATIONS

Attributes

hatch[RW]

Public Class Methods

new(hrsago) click to toggle source
# File lib/petli/poop.rb, line 10
def initialize(hrsago)
  @frame = 0
  self.hatch = hours_ago(hrsago)
end

Public Instance Methods

step() click to toggle source
# File lib/petli/poop.rb, line 15
def step
  @frame += 1
  anim_fram = (@frame/2).ceil
  @frame = 0 if anim_fram >= ANIMATION.count
  ANIMATION[anim_fram]
end
to_json(opts) click to toggle source
# File lib/petli/poop.rb, line 22
def to_json(opts)
  self.hatch.to_json
end