Class: Dobedobedo::Alert

Inherits:
Object
  • Object
show all
Defined in:
lib/dobedobedo/alert.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token, h = {}) ⇒ Alert

Returns a new instance of Alert.



5
6
7
8
9
10
11
12
13
# File 'lib/dobedobedo/alert.rb', line 5

def initialize(token, h={})
  @token = token
  unless h.nil?
    h.each do |k,v|
      Alert.send(:attr_accessor, k.to_sym)
      self.send("#{k}=".to_sym, v)
    end
  end
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



3
4
5
# File 'lib/dobedobedo/alert.rb', line 3

def token
  @token
end

Instance Method Details

#mark_readObject



15
16
17
# File 'lib/dobedobedo/alert.rb', line 15

def mark_read
  @token.put("/alerts/#{@id}", :body => {:is_read => "true"}.to_json)
end