class BadASS::Toy

Base class containing a Bad Dragon toy and it's attributes.

Attributes

color[R]

@return [String] the color of the toy

colors[R]

@return [Array(Integer, Integer, Integer)] the 3 colors of the toy

flop_reason[R]

@return [String] the flop reason of a toy

id[R]

@return [Integer] the ID of the toy

images[R]

@return [Array] the image URLs of a toy

price[R]

@return [Integer] the price of the toy

size[R]

@return [String] the size of the toy

sku[R]

@return [String] the SKU of the toy

type[R]

@return [String] the type of a toy

weight[R]

@return [Float] the weight of the toy

Public Class Methods

new(toy_hash) click to toggle source

Create a Toy object using a hash from the API. @param [Hash]

# File lib/badass/toy.rb, line 5
def initialize(toy_hash)
  @id = toy_hash['id']
  @sku = toy_hash['sku']
  @size = toy_hash['size']
  @firmness = toy_hash['firmness']
  @price = toy_hash['price']
  @weight = toy_hash['weight']
  @color = toy_hash['color']
  @colors = [toy_hash['color1'], toy_hash['color2'], toy_hash['color3']]
  @flop_reason = toy_hash['flop_reason'].capitalize
  @type = toy_hash['type'].capitalize
  @cumtube = toy_hash['cumtube']
  @suction_cup = toy_hash['suction_cup']
  @images = toy_hash['images'].map { |toy| toy['fullFilename'] }
end

Public Instance Methods

cumtube?() click to toggle source

Checks if a toy has a cumtube or not. @return [Boolean]

# File lib/badass/toy.rb, line 29
def cumtube?
  @cumtube == 1
end
firmness() click to toggle source

Gets the firmness of a toy. @return [String]

# File lib/badass/toy.rb, line 41
def firmness
  BadASS::FIRMNESSES[@firmness]
end
name() click to toggle source

Gets the full product name of the toy. @return [String]

# File lib/badass/toy.rb, line 23
def name
  BadASS::BAD_DRAGON_SKUS[@sku]
end
suction_cup?() click to toggle source

Checks if a toy has a suction cup or not. @return [Boolean]

# File lib/badass/toy.rb, line 35
def suction_cup?
  @suction_cup == 1
end