Class: Redd::Thing
- Defined in:
- lib/redd/thing.rb,
lib/redd/thing/editable.rb,
lib/redd/thing/hideable.rb,
lib/redd/thing/saveable.rb,
lib/redd/thing/voteable.rb,
lib/redd/thing/inboxable.rb,
lib/redd/thing/reportable.rb,
lib/redd/thing/messageable.rb,
lib/redd/thing/moderatable.rb
Overview
A reddit thing.
Direct Known Subclasses
Object::Comment, Object::PrivateMessage, Object::Submission, Object::Subreddit, Object::User
Defined Under Namespace
Modules: Editable, Hideable, Inboxable, Messageable, Moderatable, Reportable, Saveable, Voteable
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
The id value for the thing.
-
#kind ⇒ String
readonly
The kind of the thing.
Attributes inherited from Base
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Check for equality.
-
#fullname ⇒ String
The fullname of the thing.
Methods inherited from Base
#[], attr_reader, define_attribute_method, define_predicate_method, #initialize
Constructor Details
This class inherits a constructor from Redd::Base
Instance Attribute Details
#id ⇒ String (readonly)
Returns The id value for the thing.
9 10 11 |
# File 'lib/redd/thing.rb', line 9 def id @id end |
#kind ⇒ String (readonly)
Returns The kind of the thing.
13 14 15 |
# File 'lib/redd/thing.rb', line 13 def kind @kind end |
Instance Method Details
#==(other) ⇒ Boolean
Check for equality.
18 19 20 |
# File 'lib/redd/thing.rb', line 18 def ==(other) other.is_a?(Redd::Thing) && full_name == other.full_name end |
#fullname ⇒ String
Returns The fullname of the thing.
23 24 25 |
# File 'lib/redd/thing.rb', line 23 def fullname @fullname ||= (attributes[:name] || "#{kind}_#{id}") end |