Class: MTG::Card

Inherits:
Object
  • Object
show all
Includes:
CardRepresenter, Roar::JSON
Defined in:
lib/mtg_sdk/card.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#artistObject

Returns the value of attribute artist.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def artist
  @artist
end

#borderObject

Returns the value of attribute border.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def border
  @border
end

#cmcObject

Returns the value of attribute cmc.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def cmc
  @cmc
end

#color_identityObject

Returns the value of attribute color_identity.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def color_identity
  @color_identity
end

#colorsObject

Returns the value of attribute colors.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def colors
  @colors
end

#flavorObject

Returns the value of attribute flavor.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def flavor
  @flavor
end

#foreign_namesObject

Returns the value of attribute foreign_names.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def foreign_names
  @foreign_names
end

#handObject

Returns the value of attribute hand.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def hand
  @hand
end

#idObject

Returns the value of attribute id.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def image_url
  @image_url
end

#layoutObject

Returns the value of attribute layout.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def layout
  @layout
end

#legalitiesObject

Returns the value of attribute legalities.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def legalities
  @legalities
end

#lifeObject

Returns the value of attribute life.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def life
  @life
end

#loyaltyObject

Returns the value of attribute loyalty.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def loyalty
  @loyalty
end

#mana_costObject

Returns the value of attribute mana_cost.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def mana_cost
  @mana_cost
end

#multiverse_idObject

Returns the value of attribute multiverse_id.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def multiverse_id
  @multiverse_id
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def name
  @name
end

#namesObject

Returns the value of attribute names.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def names
  @names
end

#numberObject

Returns the value of attribute number.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def number
  @number
end

#original_textObject

Returns the value of attribute original_text.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def original_text
  @original_text
end

#original_typeObject

Returns the value of attribute original_type.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def original_type
  @original_type
end

#powerObject

Returns the value of attribute power.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def power
  @power
end

#printingsObject

Returns the value of attribute printings.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def printings
  @printings
end

#rarityObject

Returns the value of attribute rarity.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def rarity
  @rarity
end

#release_dateObject

Returns the value of attribute release_date.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def release_date
  @release_date
end

#reservedObject

Returns the value of attribute reserved.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def reserved
  @reserved
end

#rulingsObject

Returns the value of attribute rulings.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def rulings
  @rulings
end

#setObject

Returns the value of attribute set.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def set
  @set
end

#set_nameObject

Returns the value of attribute set_name.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def set_name
  @set_name
end

#sourceObject

Returns the value of attribute source.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def source
  @source
end

#starterObject

Returns the value of attribute starter.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def starter
  @starter
end

#subtypesObject

Returns the value of attribute subtypes.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def subtypes
  @subtypes
end

#supertypesObject

Returns the value of attribute supertypes.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def supertypes
  @supertypes
end

#textObject

Returns the value of attribute text.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def text
  @text
end

#timeshiftedObject

Returns the value of attribute timeshifted.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def timeshifted
  @timeshifted
end

#toughnessObject

Returns the value of attribute toughness.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def toughness
  @toughness
end

#typeObject

Returns the value of attribute type.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def type
  @type
end

#typesObject

Returns the value of attribute types.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def types
  @types
end

#variationsObject

Returns the value of attribute variations.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def variations
  @variations
end

#watermarkObject

Returns the value of attribute watermark.



8
9
10
# File 'lib/mtg_sdk/card.rb', line 8

def watermark
  @watermark
end

Class Method Details

.allArray<Card>

Get all cards from a query by paging through data

Returns:

  • (Array<Card>)

    Array of Card objects



32
33
34
# File 'lib/mtg_sdk/card.rb', line 32

def self.all
  QueryBuilder.new(Card).all
end

.find(id) ⇒ Card

Find a single card by the card multiverse id

Parameters:

  • id (Integer)

    the multiverse id

Returns:

  • (Card)

    the Card object response



25
26
27
# File 'lib/mtg_sdk/card.rb', line 25

def self.find(id)
  QueryBuilder.new(Card).find(id)
end

.ResourceString

Get the resource string

Returns:

  • (String)

    The API resource string



17
18
19
# File 'lib/mtg_sdk/card.rb', line 17

def self.Resource
  "cards"
end

.where(args) ⇒ QueryBuilder

Adds a parameter to the hash of query parameters

Parameters:

  • args (Hash)

    the query parameter

Returns:



40
41
42
# File 'lib/mtg_sdk/card.rb', line 40

def self.where(args)
  QueryBuilder.new(Card).where(args)
end