Class: Brickset::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/brickset/set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Set

setID Integer Unique database primary key number String e.g. 6876 numberVariant Integer e.g. 1 name String year String theme String themeGroup String As used on brickset.com/browse/sets subtheme String pieces String Integer, or null if pieces not known. minifigs String Integer, or null if no minifigs or not known. image Boolean imageFilename String Returned only if an image is available (image=true) thumbnailURL String Returned only if an image is available (image=true). Max dimensions 96x72. largeThumbnailURL String Returned only if an image is available (image=true). Max dimensions 240x180. imageURL String Returned only if an image is available (image=true). Max dimensions 690x690. bricksetURL String URL of set details page at Brickset.com released Boolean owned Boolean Returned only if userHash or userName is passed to method wanted Boolean Returned only if userHash or userName is passed to method qtyOwned Integer Returned only if userHash or userName is passed to method ACMDataCount Integer Number of ACM records user has modified for this set userNotes String Returned only if userHash or userName is passed to method ownedByTotal Integer Number of people who own this set wantedByTotal Integer Number of people who want this set UKRetailPrice String USRetailPrice String CARetailPrice String EURetailPrice String USDateAddedToSAH String The date the set was first sold as shop.LEGO.com in the USA USDateRemovedFromSAH String The date the set was last sold as shop.LEGO.com in the USA. If USDateAddedToSAH is not blank but this is, it’s still available. rating Decimal reviewCount Integer packagingType String availability String instructionsCount Integer additionalImageCount Integer EAN String UPC String description String Returned only with call to getSet lastUpdated Date



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/brickset/set.rb', line 50

def initialize(data)
  @id = data.dig(:set_id).to_i
  @number = data.dig(:number)
  @number_variant = data.dig(:number_variant).to_i
  @name = data.dig(:name)
  @year = data.dig(:year)
  @theme = data.dig(:theme)
  @theme_group = data.dig(:theme_group)
  @subtheme = data.dig(:subtheme)
  @pieces = data.dig(:pieces)
  @minifigs = data.dig(:minifigs)
  @image = data.dig(:image)
  @image_filename = data.dig(:image_filename)
  @thumbnail_url = data.dig(:thumbnail_url)
  @large_thumbnail_url = data.dig(:large_thumbnail_url)
  @image_url = data.dig(:image_url)
  @brickset_url = data.dig(:brickset_url)
  @released = data.dig(:released)
  @owned = data.dig(:owned)
  @wanted = data.dig(:wanted)
  @qty_owned = data.dig(:qty_owned)
  @acm_data_count = data.dig(:acm_data_count).to_i
  @user_notes = data.dig(:user_notes)
  @owned_by_total = data.dig(:owned_by_total).to_i
  @wanted_by_total = data.dig(:wanted_by_total).to_i
  @uk_retail_price = data.dig(:uk_retail_price)
  @us_retail_price = data.dig(:us_retail_price)
  @ca_retail_price = data.dig(:ca_retail_price)
  @eu_retail_price = data.dig(:eu_retail_price)
  @us_date_added_to_sah = data.dig(:us_date_added_to_sah)
  @us_date_removed_from_sah = data.dig(:us_date_removed_from_sah)
  @rating = data.dig(:rating)
  @review_count = data.dig(:review_count).to_i
  @packaging_type = data.dig(:packaging_type)
  @availability = data.dig(:availability)
  @instructions_count = data.dig(:instructions_count).to_i
  @additional_image_count = data.dig(:additional_image_count).to_i
  @ean = data.dig(:ean)
  @upc = data.dig(:upc)
  @description = data.dig(:description)
  @last_updated = data.dig(:last_updated)
end

Instance Attribute Details

#acm_data_countObject

Returns the value of attribute acm_data_count.



3
4
5
# File 'lib/brickset/set.rb', line 3

def acm_data_count
  @acm_data_count
end

#additional_image_countObject

Returns the value of attribute additional_image_count.



3
4
5
# File 'lib/brickset/set.rb', line 3

def additional_image_count
  @additional_image_count
end

#availabilityObject

Returns the value of attribute availability.



3
4
5
# File 'lib/brickset/set.rb', line 3

def availability
  @availability
end

#brickset_urlObject

Returns the value of attribute brickset_url.



3
4
5
# File 'lib/brickset/set.rb', line 3

def brickset_url
  @brickset_url
end

#ca_retail_priceObject

Returns the value of attribute ca_retail_price.



3
4
5
# File 'lib/brickset/set.rb', line 3

def ca_retail_price
  @ca_retail_price
end

#eanObject

Returns the value of attribute ean.



3
4
5
# File 'lib/brickset/set.rb', line 3

def ean
  @ean
end

#eu_retail_priceObject

Returns the value of attribute eu_retail_price.



3
4
5
# File 'lib/brickset/set.rb', line 3

def eu_retail_price
  @eu_retail_price
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/brickset/set.rb', line 3

def id
  @id
end

#imageObject

Returns the value of attribute image.



3
4
5
# File 'lib/brickset/set.rb', line 3

def image
  @image
end

#image_filenameObject

Returns the value of attribute image_filename.



3
4
5
# File 'lib/brickset/set.rb', line 3

def image_filename
  @image_filename
end

#image_urlObject

Returns the value of attribute image_url.



3
4
5
# File 'lib/brickset/set.rb', line 3

def image_url
  @image_url
end

#instructions_countObject

Returns the value of attribute instructions_count.



3
4
5
# File 'lib/brickset/set.rb', line 3

def instructions_count
  @instructions_count
end

#large_thumbnail_urlObject

Returns the value of attribute large_thumbnail_url.



3
4
5
# File 'lib/brickset/set.rb', line 3

def large_thumbnail_url
  @large_thumbnail_url
end

#last_updatedObject

Returns the value of attribute last_updated.



3
4
5
# File 'lib/brickset/set.rb', line 3

def last_updated
  @last_updated
end

#minifigsObject

Returns the value of attribute minifigs.



3
4
5
# File 'lib/brickset/set.rb', line 3

def minifigs
  @minifigs
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/brickset/set.rb', line 3

def name
  @name
end

#numberObject

Returns the value of attribute number.



3
4
5
# File 'lib/brickset/set.rb', line 3

def number
  @number
end

#number_variantObject

Returns the value of attribute number_variant.



3
4
5
# File 'lib/brickset/set.rb', line 3

def number_variant
  @number_variant
end

#ownedObject

Returns the value of attribute owned.



3
4
5
# File 'lib/brickset/set.rb', line 3

def owned
  @owned
end

#owned_by_totalObject

Returns the value of attribute owned_by_total.



3
4
5
# File 'lib/brickset/set.rb', line 3

def owned_by_total
  @owned_by_total
end

#packaging_typeObject

Returns the value of attribute packaging_type.



3
4
5
# File 'lib/brickset/set.rb', line 3

def packaging_type
  @packaging_type
end

#piecesObject

Returns the value of attribute pieces.



3
4
5
# File 'lib/brickset/set.rb', line 3

def pieces
  @pieces
end

#qty_ownedObject

Returns the value of attribute qty_owned.



3
4
5
# File 'lib/brickset/set.rb', line 3

def qty_owned
  @qty_owned
end

#ratingObject

Returns the value of attribute rating.



3
4
5
# File 'lib/brickset/set.rb', line 3

def rating
  @rating
end

#releasedObject

Returns the value of attribute released.



3
4
5
# File 'lib/brickset/set.rb', line 3

def released
  @released
end

#review_countObject

Returns the value of attribute review_count.



3
4
5
# File 'lib/brickset/set.rb', line 3

def review_count
  @review_count
end

#subthemeObject

Returns the value of attribute subtheme.



3
4
5
# File 'lib/brickset/set.rb', line 3

def subtheme
  @subtheme
end

#themeObject

Returns the value of attribute theme.



3
4
5
# File 'lib/brickset/set.rb', line 3

def theme
  @theme
end

#theme_groupObject

Returns the value of attribute theme_group.



3
4
5
# File 'lib/brickset/set.rb', line 3

def theme_group
  @theme_group
end

#thumbnail_urlObject

Returns the value of attribute thumbnail_url.



3
4
5
# File 'lib/brickset/set.rb', line 3

def thumbnail_url
  @thumbnail_url
end

#uk_retail_priceObject

Returns the value of attribute uk_retail_price.



3
4
5
# File 'lib/brickset/set.rb', line 3

def uk_retail_price
  @uk_retail_price
end

#upcObject

Returns the value of attribute upc.



3
4
5
# File 'lib/brickset/set.rb', line 3

def upc
  @upc
end

#us_date_added_to_sahObject

Returns the value of attribute us_date_added_to_sah.



3
4
5
# File 'lib/brickset/set.rb', line 3

def us_date_added_to_sah
  @us_date_added_to_sah
end

#us_date_removed_from_sahObject

Returns the value of attribute us_date_removed_from_sah.



3
4
5
# File 'lib/brickset/set.rb', line 3

def us_date_removed_from_sah
  @us_date_removed_from_sah
end

#us_retail_priceObject

Returns the value of attribute us_retail_price.



3
4
5
# File 'lib/brickset/set.rb', line 3

def us_retail_price
  @us_retail_price
end

#wantedObject

Returns the value of attribute wanted.



3
4
5
# File 'lib/brickset/set.rb', line 3

def wanted
  @wanted
end

#wanted_by_totalObject

Returns the value of attribute wanted_by_total.



3
4
5
# File 'lib/brickset/set.rb', line 3

def wanted_by_total
  @wanted_by_total
end

#yearObject

Returns the value of attribute year.



3
4
5
# File 'lib/brickset/set.rb', line 3

def year
  @year
end