class Smyte::Notification::Item
Attributes
responses[R]
Public Class Methods
new(first_response)
click to toggle source
# File lib/smyte/notification.rb, line 48 def initialize(first_response) @responses = [first_response] end
Public Instance Methods
id()
click to toggle source
# File lib/smyte/notification.rb, line 60 def id @id ||= key.split("/").last end
key()
click to toggle source
# File lib/smyte/notification.rb, line 52 def key @item ||= responses.first["item"] end
type()
click to toggle source
# File lib/smyte/notification.rb, line 56 def type @type ||= key.split("/").first end
Protected Instance Methods
add_response(response)
click to toggle source
# File lib/smyte/notification.rb, line 66 def add_response(response) reset_labels responses << response responses end
parse_labels()
click to toggle source
# File lib/smyte/notification.rb, line 72 def parse_labels out = [] responses.each do |hash| out << Smyte::Notification::Label.new(hash) end out end