Sha256: 66dc3c582ca95a9a35884443e2b30fd087beb2653a4c6854ed15cfeda12ec20b

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

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
                  
    # 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 [QueryBuilder] the QueryBuilder
    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-2.3.0 lib/pokemon_tcg_sdk/set.rb