class NeonRAW::Objects::InboxComment

The inboxed comment object. @!attribute [r] body

@return [String, nil] Returns the text body of the comment or nil if
  there is none.

@!attribute [r] link_title

@return [String] Returns the title of the submission where the comment
  was posted.

@!attribute [r] dest

@return [String] Returns whom the InboxComment was sent to.

@!attribute [r] author

@return [String] Returns the author of the comment.

@!attribute [r] body_html

@return [String, nil] Returns the text body of the comment with HTML or
  nil if there is none.

@!attribute [r] subreddit

@return [String] Returns the subreddit where the comment was posted.

@!attribute [r] parent_id

@return [String] Returns the fullname of the comment's parent object.

@!attribute [r] context

@return [String] Returns a link to the comment with context provided.

@!attribute [r] new?

@return [Boolean] Returns whether the comment is new or not.

@!attribute [r] subject

@return [String] Returns the subject of the comment (post/comment
  reply).

Public Class Methods

new(client, data) click to toggle source

@!method initialize(client, data) @param client [NeonRAW::Clients::Web/Installed/Script] The client. @param data [Hash] The object data.

# File lib/NeonRAW/objects/inboxcomment.rb, line 40
def initialize(client, data)
  @client = client
  data.each do |key, value|
    # for consistency, empty strings/arrays/hashes are set to nil
    # because most of the keys returned by Reddit are nil when they
    # don't have a value, besides a few
    value = nil if ['', [], {}].include?(value)
    instance_variable_set(:"@#{key}", value)
    next if %i[created created_utc].include?(key)
    self.class.send(:attr_reader, key)
  end
  class << self
    alias_method :new?, :new
  end
end
Also aliased as: new?
new?(client, data)
Alias for: new