Sha256: dee0aca3152d048ab4b9dd7a020c0120bd5a61ed5f0ebcf6a67ba076cdc30f2a

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require_relative 'representers/set_representer'

module Pokemon
  class Set
    include Roar::JSON
    include SetRepresenter

    attr_accessor :code, :name, :series, :total_cards, :standard_legal, :expanded_legal, :release_date,
                  :symbol_url, :logo_url, :ptcgo_code, :updated_at

    # Get the resource string
    #
    # @return [String] The API resource string
    def self.Resource
      "sets"
    end
    
    # Find a single set by the set code
    #
    # @param id [String] the set code
    # @return [Set] the Set object response
    def self.find(id)
      QueryBuilder.new(Set).find(id)
    end

    # Get all sets from a query by paging through data
    #
    # @return [Array<Set>] Array of Set objects
    def self.all
      QueryBuilder.new(Set).all
    end
    
    # Adds a parameter to the hash of query parameters
    #
    # @param args [Hash] the query parameter
    # @return [Array<Set>] Array of Set objects
    def self.where(args)
      QueryBuilder.new(Set).where(args)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pokemon_tcg_sdk-3.0.0 lib/pokemon_tcg_sdk/set.rb