class HipTail::Message

Attributes

raw[R]

Public Class Methods

new(params) click to toggle source
# File lib/hiptail/atom.rb, line 55
def initialize(params)
  @raw = params.dup
end

Public Instance Methods

date() click to toggle source

@attribute [r] date @return [Time]

# File lib/hiptail/atom.rb, line 67
def date
  @date ||= Time.parse(@raw['date'])
  @date
end
from() click to toggle source

@attribute [r] from @return [HipTail::User]

# File lib/hiptail/atom.rb, line 74
def from
  @from ||= User.create(@raw['from'])
  @from
end
id() click to toggle source

@attribute [r] id @return [String]

# File lib/hiptail/atom.rb, line 61
def id
  @raw['id']
end
is_notification?() click to toggle source

@attribute [r] is_notification?

# File lib/hiptail/atom.rb, line 104
def is_notification?
  false
end
is_talk?() click to toggle source

@attribute [r] is_talk?

# File lib/hiptail/atom.rb, line 99
def is_talk?
  false
end
mentions() click to toggle source

@attribute [r] mentions @return [Array] Array of HipTail::User.

# File lib/hiptail/atom.rb, line 81
def mentions
  @mentions ||= (@raw['mentions'] || []).map { |data| User.create(data) }
  @mentions
end
message() click to toggle source

@attribute [r] message @return [String]

# File lib/hiptail/atom.rb, line 88
def message
  @raw['message']
end
text() click to toggle source

@attribute [r] text @return [String]

# File lib/hiptail/atom.rb, line 94
def text
  message
end