Method: Radiator::Chain#find_comment

Defined in:
lib/radiator/chain.rb

#find_comment(*args) ⇒ ::Hash

Find a specific comment by author and permlink or slug.

Example:

steem = Radiator::Chain.new(chain: :steem)
comment = steem.find_comment('inertia', 'kinda-spooky') # by account, permlink
active_votes = comment.active_votes

… or …

comment = steem.find_comment('@inertia/kinda-spooky') # by slug

Parameters:

  • args (String || ::Array<String>)

    Slug or author, permlink of comment.

Returns:

  • (::Hash)


113
114
115
116
117
118
119
120
121
# File 'lib/radiator/chain.rb', line 113

def find_comment(*args)
  author, permlink = Chain.parse_slug(args)
  
  api.get_content(author, permlink) do |comment, err|
    raise ChainError, ErrorParser.new(err) if !!err
    
    comment unless comment.id == 0
  end
end