Sha256: 17daf055d0625e84fbbf025312c472a38cbf9d454c2c6f82074fd8dfd22b26ce

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 Bytes

Contents

require "vobject/component"
require "vobject/vcard/v4_0/property"
require "vobject/vcard/v4_0/grammar"
require "pp"

module Vcard::V4_0
  class Component < Vobject::Component
    class << self
      def parse(vcf, strict)
        hash = Vcard::V4_0::Grammar.new(strict).parse(vcf)
        comp_name = hash.keys.first
        new comp_name, hash[comp_name], hash[:errors]
      end

      private

      def raise_invalid_parsing
        raise "vCard parse failed"
      end
    end

    private

    def property_base_class
      version_class.const_get(:Property)
    end

    def component_base_class
      version_class.const_get(:Component)
    end

    def parameter_base_class
      version_class.const_get(:Parameter)
    end

    def version_class
      Vcard::V4_0
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vobject-1.1.0 lib/vobject/vcard/v4_0/component.rb
ruby-vobject-1.0.99 lib/vobject/vcard/v4_0/component.rb
vobject-1.0.2 lib/vobject/vcard/v4_0/component.rb
ruby-vobject-1.0.1 lib/vobject/vcard/v4_0/component.rb
ruby-vobject-1.0.0-x86_64-darwin-18 lib/vobject/vcard/v4_0/component.rb
ruby-vobject-0.2.0-x86_64-darwin-16 lib/vobject/vcard/v4_0/component.rb