Sha256: b14de5f123eaa0c1d2fe322461380302f37b64ef19584ac459ae701d586e7bf4

Contents?: true

Size: 1017 Bytes

Versions: 6

Compression:

Stored size: 1017 Bytes

Contents

require "microformat/format"

module Microformat
  class Card < Format
    selector ".vcard"
    
    attribute_definition do |root|
      root.attribute(:fn, required: true)
      root.attribute(:n) do |n|
        n.attribute(:"honorific-prefix")
        n.attribute(:"given-name")
        n.attribute(:"additional-name")
        n.attribute(:"family-name")
        n.attribute(:"honorific-suffix")
      end
      root.attribute(:nickname)
      root.attribute(:org)
      root.attribute(:photo, cast: :url, attribute: ["href", "src"])
      root.attribute(:url, cast: :url, attribute: "href")
      root.attribute(:email, cast: :email)
      root.attribute(:tel, cast: :tel)
      root.attribute(:adr) do |adr|
        adr.attribute(:"street-address")
        adr.attribute(:locality)
        adr.attribute(:region)
        adr.attribute(:"postal-code")
        adr.attribute(:"country-name")
      end
      root.attribute(:"bday")
      root.attribute(:"category")
      root.attribute(:"note")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
microformat-0.0.7 lib/microformat/card.rb
microformat-0.0.6 lib/microformat/card.rb
microformat-0.0.5 lib/microformat/card.rb
microformat-0.0.4 lib/microformat/card.rb
microformat-0.0.3 lib/microformat/card.rb
microformat-0.0.2 lib/microformat/card.rb