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.



21
22
23
24
# File 'lib/mastodon/notification.rb', line 21

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

Instance Attribute Details

#accountMastodon::Account (readonly)

Returns:



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

normal_attr_reader :id, :type, :created_at

#created_atString (readonly)

Returns:

  • (String)


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

normal_attr_reader :id, :type, :created_at

#idString (readonly)

Returns:

  • (String)


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

normal_attr_reader :id, :type, :created_at

#statusMastodon::Status (readonly)

Returns:



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

normal_attr_reader :id, :type, :created_at

#typeString (readonly)

Returns:

  • (String)


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

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



28
29
30
# File 'lib/mastodon/notification.rb', line 28

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