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

Returns a new instance of 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)

Returns:



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

normal_attr_reader :id, :type, :created_at

#created_atString (readonly)

Returns:

  • (String)


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

normal_attr_reader :id, :type, :created_at

#idString (readonly)

Returns:

  • (String)


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

normal_attr_reader :id, :type, :created_at

#statusMastodon::Status (readonly)

Returns:



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

normal_attr_reader :id, :type, :created_at

#typeString (readonly)

Returns:

  • (String)


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?

Returns:

  • (Boolean)

    true if a status is included, false otherwise



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

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