Class: TCGPlayerSDK::ProductPrice

Inherits:
ResponseStruct show all
Defined in:
lib/tcg-player-sdk/product_price_list.rb

Overview

A wrapper around the ResponseStruct for an individual product subtype’s price.

{
         "productId" => 85737,
          "lowPrice" => nil,
          "midPrice" => nil,
         "highPrice" => nil,
       "marketPrice" => nil,
    "directLowPrice" => nil,
       "subTypeName" => "Unlimited Holofoil"
},

Instance Method Summary collapse

Methods inherited from ResponseStruct

#each, #keys, #method_missing, #respond_to_missing?, #to_h, #to_s, #try

Constructor Details

#initialize(hash = nil) ⇒ ProductPrice

Returns a new instance of ProductPrice.



75
76
77
# File 'lib/tcg-player-sdk/product_price_list.rb', line 75

def initialize(hash = nil)
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TCGPlayerSDK::ResponseStruct

Instance Method Details

#has_valid_prices?Boolean

Returns false if there are no non-nil prices

Returns:

  • (Boolean)

    Returns false if there are no non-nil prices



81
82
83
# File 'lib/tcg-player-sdk/product_price_list.rb', line 81

def has_valid_prices?
  return !(lowPrice.nil? && midPrice.nil? && highPrice.nil? && directLowPrice.nil? && marketPrice.nil?)
end