class ReplTalk::Tag

Attributes

creator_count[R]
id[R]
repl_count[R]
repls_tagged_today_count[R]

Public Class Methods

new(client, tag) click to toggle source
# File lib/repltalk/structures.rb, line 80
def initialize(client, tag)
        @client = client

        @id = tag["id"]
        @repl_count = tag["replCount"]
        @is_trending = tag["isTrending"]
        @creator_count = tag["creatorCount"]
        @repls_tagged_today_count = tag["replsTaggedTodayCount"]
end

Public Instance Methods

get_repls(count: nil, after: nil) click to toggle source
# File lib/repltalk/structures.rb, line 90
def get_repls(count: nil, after: nil)
        r = @client.graphql(
                "ExploreTrendingRepls",
                GQL::Queries::GET_TAGS_REPLS,
                tag: @id,
                count: count,
                after: after
        )
        r["tag"]["repls"]["items"].map { |repl| Repl.new(@client, repl) }
end
to_s() click to toggle source
# File lib/repltalk/structures.rb, line 101
def to_s
        @id
end