Class: Brickset::Set
- Inherits:
-
Object
- Object
- Brickset::Set
- Defined in:
- lib/brickset/set.rb
Instance Attribute Summary collapse
-
#acm_data_count ⇒ Object
Returns the value of attribute acm_data_count.
-
#additional_image_count ⇒ Object
Returns the value of attribute additional_image_count.
-
#availability ⇒ Object
Returns the value of attribute availability.
-
#brickset_url ⇒ Object
Returns the value of attribute brickset_url.
-
#ca_retail_price ⇒ Object
Returns the value of attribute ca_retail_price.
-
#ean ⇒ Object
Returns the value of attribute ean.
-
#eu_retail_price ⇒ Object
Returns the value of attribute eu_retail_price.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image ⇒ Object
Returns the value of attribute image.
-
#image_filename ⇒ Object
Returns the value of attribute image_filename.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#instructions_count ⇒ Object
Returns the value of attribute instructions_count.
-
#large_thumbnail_url ⇒ Object
Returns the value of attribute large_thumbnail_url.
-
#last_updated ⇒ Object
Returns the value of attribute last_updated.
-
#minifigs ⇒ Object
Returns the value of attribute minifigs.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#number_variant ⇒ Object
Returns the value of attribute number_variant.
-
#owned ⇒ Object
Returns the value of attribute owned.
-
#owned_by_total ⇒ Object
Returns the value of attribute owned_by_total.
-
#packaging_type ⇒ Object
Returns the value of attribute packaging_type.
-
#pieces ⇒ Object
Returns the value of attribute pieces.
-
#qty_owned ⇒ Object
Returns the value of attribute qty_owned.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#released ⇒ Object
Returns the value of attribute released.
-
#review_count ⇒ Object
Returns the value of attribute review_count.
-
#subtheme ⇒ Object
Returns the value of attribute subtheme.
-
#theme ⇒ Object
Returns the value of attribute theme.
-
#theme_group ⇒ Object
Returns the value of attribute theme_group.
-
#thumbnail_url ⇒ Object
Returns the value of attribute thumbnail_url.
-
#uk_retail_price ⇒ Object
Returns the value of attribute uk_retail_price.
-
#upc ⇒ Object
Returns the value of attribute upc.
-
#us_date_added_to_sah ⇒ Object
Returns the value of attribute us_date_added_to_sah.
-
#us_date_removed_from_sah ⇒ Object
Returns the value of attribute us_date_removed_from_sah.
-
#us_retail_price ⇒ Object
Returns the value of attribute us_retail_price.
-
#wanted ⇒ Object
Returns the value of attribute wanted.
-
#wanted_by_total ⇒ Object
Returns the value of attribute wanted_by_total.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(data) ⇒ Set
constructor
setID Integer Unique database primary key number String e.g.
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_count ⇒ Object
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_count ⇒ Object
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 |
#availability ⇒ Object
Returns the value of attribute availability.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def availability @availability end |
#brickset_url ⇒ Object
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_price ⇒ Object
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 |
#ean ⇒ Object
Returns the value of attribute ean.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def ean @ean end |
#eu_retail_price ⇒ Object
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 |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def id @id end |
#image ⇒ Object
Returns the value of attribute image.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def image @image end |
#image_filename ⇒ Object
Returns the value of attribute image_filename.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def image_filename @image_filename end |
#image_url ⇒ Object
Returns the value of attribute image_url.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def image_url @image_url end |
#instructions_count ⇒ Object
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_url ⇒ Object
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_updated ⇒ Object
Returns the value of attribute last_updated.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def last_updated @last_updated end |
#minifigs ⇒ Object
Returns the value of attribute minifigs.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def minifigs @minifigs end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def number @number end |
#number_variant ⇒ Object
Returns the value of attribute number_variant.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def number_variant @number_variant end |
#owned ⇒ Object
Returns the value of attribute owned.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def owned @owned end |
#owned_by_total ⇒ Object
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_type ⇒ Object
Returns the value of attribute packaging_type.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def packaging_type @packaging_type end |
#pieces ⇒ Object
Returns the value of attribute pieces.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def pieces @pieces end |
#qty_owned ⇒ Object
Returns the value of attribute qty_owned.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def qty_owned @qty_owned end |
#rating ⇒ Object
Returns the value of attribute rating.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def @rating end |
#released ⇒ Object
Returns the value of attribute released.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def released @released end |
#review_count ⇒ Object
Returns the value of attribute review_count.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def review_count @review_count end |
#subtheme ⇒ Object
Returns the value of attribute subtheme.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def subtheme @subtheme end |
#theme ⇒ Object
Returns the value of attribute theme.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def theme @theme end |
#theme_group ⇒ Object
Returns the value of attribute theme_group.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def theme_group @theme_group end |
#thumbnail_url ⇒ Object
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_price ⇒ Object
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 |
#upc ⇒ Object
Returns the value of attribute upc.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def upc @upc end |
#us_date_added_to_sah ⇒ Object
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_sah ⇒ Object
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_price ⇒ Object
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 |
#wanted ⇒ Object
Returns the value of attribute wanted.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def wanted @wanted end |
#wanted_by_total ⇒ Object
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 |
#year ⇒ Object
Returns the value of attribute year.
3 4 5 |
# File 'lib/brickset/set.rb', line 3 def year @year end |