Sha256: 127de746826447a04e8961acde95b03369cb786981daa44c6d213129a02929c2
Contents?: true
Size: 726 Bytes
Versions: 7
Compression:
Stored size: 726 Bytes
Contents
Gem.find_files("hentry_consumer/element.rb").each { |path| require path } module HentryConsumer class HCard < Element attr_accessor :name, :email, :url alias_method :emails, :email alias_method :urls, :url def parse_p_name(element) assign_value :name, element.text end def parse_u_email(element) assign_value :email, element["href"] end def parse_u_url(element) assign_value :url, element["href"] end def to_hash { :type => ["h-card"], :properties => { :name => self.name, :email => self.email, :url => self.url } } end def to_json(*a) to_hash.to_json(a) end end end
Version data entries
7 entries across 7 versions & 1 rubygems