class BoardGameGem::BGGCollection
Attributes
count[R]
items[R]
Public Class Methods
new(xml)
click to toggle source
# File lib/bgg_collection.rb, line 6 def initialize(xml) @count = get_integer(xml, "items", "totalitems") @items = [] xml.css("item").each do |item| @items.push(BGGCollectionItem.new(item)) end end
Public Instance Methods
get_owned()
click to toggle source
# File lib/bgg_collection.rb, line 14 def get_owned return filter_by(:own) end
get_preordered()
click to toggle source
# File lib/bgg_collection.rb, line 38 def get_preordered return filter_by(:preordered) end
get_previously_owned()
click to toggle source
# File lib/bgg_collection.rb, line 18 def get_previously_owned return filter_by(:prev_owned) end
get_want_to_buy()
click to toggle source
# File lib/bgg_collection.rb, line 30 def get_want_to_buy return filter_by(:want_to_buy) end
get_want_to_play()
click to toggle source
# File lib/bgg_collection.rb, line 26 def get_want_to_play return filter_by(:want_to_play) end
get_wants()
click to toggle source
# File lib/bgg_collection.rb, line 22 def get_wants return filter_by(:want) end
get_wishlist()
click to toggle source
# File lib/bgg_collection.rb, line 34 def get_wishlist return filter_by(:wishlist) end
Private Instance Methods
filter_by(key)
click to toggle source
# File lib/bgg_collection.rb, line 43 def filter_by(key) return @items.select { |x| x.status[key] } end