class Ticard::Card
Attributes
content[R]
stored_md5[R]
url[R]
Public Class Methods
new(content, opts={})
click to toggle source
# File lib/ticard/card.rb, line 8 def initialize(content, opts={}) @content = content @stored_md5 = opts[:stored_md5] @url = opts[:url] end
Public Instance Methods
as_stored()
click to toggle source
# File lib/ticard/card.rb, line 22 def as_stored Card.new(@content, :url => @url, :stored_md5 => current_md5) end
current_md5()
click to toggle source
# File lib/ticard/card.rb, line 14 def current_md5 Digest::MD5.hexdigest(@content.strip) end
from_same_content_as?(other_card)
click to toggle source
# File lib/ticard/card.rb, line 18 def from_same_content_as?(other_card) @stored_md5 == other_card.stored_md5 end