Sha256: 0286979962e5acba465dd039d655f556cf5774c7a51ced9d8920f2e9f4a49b7c

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

require "shale"

require_relative "b"
require_relative "bold"
require_relative "i"
require_relative "sub"
require_relative "sup"
require_relative "tt"

module Stepmod
  module Utils
    module Parsers
      module Models
        class A < Shale::Mapper
          attribute :content, Shale::Type::String
          attribute :href, Shale::Type::String
          attribute :i, Italic, collection: true
          attribute :b, B, collection: true
          attribute :sub, Sub, collection: true
          attribute :sup, Sup, collection: true
          attribute :tt, Tt, collection: true
          attribute :bold, Bold, collection: true

          xml do
            root "a"

            map_content to: :content
            map_attribute "href", to: :href
            map_element "i", to: :i
            map_element "b", to: :b
            map_element "sub", to: :sub
            map_element "sup", to: :sup
            map_element "tt", to: :tt
            map_element "bold", to: :bold
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stepmod-utils-0.6.7 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.6 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.5 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.3 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.2 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.1 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.6.0 lib/stepmod/utils/parsers/models/a.rb
stepmod-utils-0.5.0 lib/stepmod/utils/parsers/models/a.rb