module NeonRAW::Objects::Thing::Refreshable

Methods for things that can be refreshed.

Public Instance Methods

refresh!() click to toggle source

Refreshes the data of a comment/submission/subreddit object. @!method refresh!

# File lib/NeonRAW/objects/thing/refreshable.rb, line 8
def refresh!
  params = { id: name }
  data = @client.request_data('/api/info', :get, params)
  data[:data][:children][0][:data].each do |key, value|
    value = nil if ['', [], {}].include?(value)
    instance_variable_set(:"@#{key}", value)
  end
end