Class: Mastodon::Notification

Inherits:
Base
  • Object
show all
Defined in:
lib/mastodon/notification.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

collection_attr_reader, define_attribute_method, define_predicate_method, normal_attr_reader, object_attr_reader, predicate_attr_reader

Constructor Details

#initialize(attributes = {}) ⇒ Notification


19
20
21
22
# File 'lib/mastodon/notification.rb', line 19

def initialize(attributes = {})
  attributes.fetch('id')
  super
end

Instance Attribute Details

#accountMastodon::Account (readonly)


14
# File 'lib/mastodon/notification.rb', line 14

normal_attr_reader :id, :type, :created_at

#created_atString (readonly)


14
# File 'lib/mastodon/notification.rb', line 14

normal_attr_reader :id, :type, :created_at

#idString (readonly)


14
# File 'lib/mastodon/notification.rb', line 14

normal_attr_reader :id, :type, :created_at

#statusMastodon::Status (readonly)


14
# File 'lib/mastodon/notification.rb', line 14

normal_attr_reader :id, :type, :created_at

#typeString (readonly)


14
# File 'lib/mastodon/notification.rb', line 14

normal_attr_reader :id, :type, :created_at

Instance Method Details

#status?Boolean

Does this notification include a status?


26
27
28
# File 'lib/mastodon/notification.rb', line 26

def status?
  attributes.key?('status')
end