class Remindrr::Reminder

Attributes

attempt_count[RW]
created_at[RW]
data[RW]
id[RW]
remind_at[RW]

Public Class Methods

all(app) click to toggle source
# File lib/remindrr/reminder.rb, line 13
def self.all(app)
  reminders = get("v1/apps/#{app.id}/reminders")
  reminders.map { |reminder| new reminder }
end
create(app, opts) click to toggle source
# File lib/remindrr/reminder.rb, line 23
def self.create(app, opts)
  reminder = post("v1/apps/#{app.id}/reminders", opts)
  new reminder
end
find(app, id) click to toggle source
# File lib/remindrr/reminder.rb, line 18
def self.find(app, id)
  reminder = get("v1/apps/#{app.id}/reminders/#{id}")
  new reminder
end
new(attrs) click to toggle source
# File lib/remindrr/reminder.rb, line 7
def initialize(attrs)
  attrs.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end
on(&block) click to toggle source
# File lib/remindrr/reminder.rb, line 28
def self.on(&block)
  @block = block
end
receive(data) click to toggle source
# File lib/remindrr/reminder.rb, line 32
def self.receive(data)
  @block.call(data) unless @block.nil?
end