Class: Redd::Objects::User
- Includes:
- Thing::Messageable
- Defined in:
- lib/redd/objects/user.rb
Overview
The model for a reddit user
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get_comments(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_disliked(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_gilded(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_gildings_given(**params) ⇒ Object
Get posts that the user has gilded.
-
#get_hidden(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_liked(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_overview(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_saved(**params) ⇒ Listing<Submission>
Get the appropriate listing.
-
#get_submitted(**params) ⇒ Listing<Submission>
Get the appropriate listing.
Methods included from Thing::Messageable
Methods inherited from Thing
Methods inherited from Base
Constructor Details
This class inherits a constructor from Redd::Objects::Base
Instance Method Details
#get_comments(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_disliked(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_gilded(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_gildings_given(**params) ⇒ Object
Get posts that the user has gilded.
47 48 49 |
# File 'lib/redd/objects/user.rb', line 47 def get_gildings_given(**params) get_gilded(**params.merge(show: "given")) end |
#get_hidden(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_liked(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_overview(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_saved(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |
#get_submitted(**params) ⇒ Listing<Submission>
The option :t only applies to the top and controversial sorts.
Get the appropriate listing.
35 36 37 38 39 40 41 42 43 |
# File 'lib/redd/objects/user.rb', line 35 %w( overview submitted comments liked disliked hidden saved gilded ).each do |type| define_method :"get_#{type}" do |**params| client.request_object( :get, "/user/#{name}/#{type}.json", **params ) end end |