class Roll
Attributes
item_id[RW]
notes[RW]
perks[RW]
Public Class Methods
key(item_id, perks)
click to toggle source
# File lib/dim_wishlist/roll.rb, line 7 def key(item_id, perks) Digest::SHA2.new(512).hexdigest "#{item_id},#{perks.join(',')}" end
new(item_id:, perks:, notes: nil)
click to toggle source
# File lib/dim_wishlist/roll.rb, line 12 def initialize(item_id:, perks:, notes: nil) @item_id = item_id @perks = perks @notes = notes end
Public Instance Methods
key()
click to toggle source
# File lib/dim_wishlist/roll.rb, line 18 def key self.class.key(@item_id, @perks) end
to_s()
click to toggle source
# File lib/dim_wishlist/roll.rb, line 22 def to_s "dimwishlist:item=#{@item_id}&perks=#{perks.join(',')}#{!@notes.nil? ? "#notes:#{notes}" : ''}" end