Class: Redd::Objects::Thing

Inherits:
Base
  • Object
show all
Defined in:
lib/redd/objects/thing.rb,
lib/redd/objects/thing/votable.rb,
lib/redd/objects/thing/editable.rb,
lib/redd/objects/thing/hideable.rb,
lib/redd/objects/thing/saveable.rb,
lib/redd/objects/thing/inboxable.rb,
lib/redd/objects/thing/messageable.rb,
lib/redd/objects/thing/moderatable.rb,
lib/redd/objects/thing/refreshable.rb

Overview

A reddit thing.

Direct Known Subclasses

Comment, PrivateMessage, Submission, Subreddit, User, WikiPage

Defined Under Namespace

Modules: Editable, Hideable, Inboxable, Messageable, Moderatable, Refreshable, Saveable, Votable

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

alias_property, #initialize

Constructor Details

This class inherits a constructor from Redd::Objects::Base

Instance Method Details

#==(other) ⇒ Boolean

Check for equality.

Parameters:

  • other

    The other object.

Returns:

  • (Boolean)


16
17
18
# File 'lib/redd/objects/thing.rb', line 16

def ==(other)
  other.is_a?(Thing) && fullname == other.fullname
end

#fullnameString

Returns The fullname of the thing.

Returns:

  • (String)

    The fullname of the thing.



21
22
23
# File 'lib/redd/objects/thing.rb', line 21

def fullname
  self[:name] || "#{kind}_#{id}"
end