Sha256: d7f717e43caf6ac0c1b78dd70ecde149f938e9fea018b2d6c6bbd73ab2d55486

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

module Druid
  module Elements
    class << self

      def type_to_class
        @type_to_class ||= {}
      end

      # method to return the collection of tag_name class mappings
      def tag_to_class
        @tag_to_class ||= {}
      end

      #
      # method to return the element for a tag_name
      #
      def element_class_for(tag_name, type=nil)
        return type_to_class[type.to_sym] if type
        tag_to_class[tag_name.to_sym] || Druid::Elements::Element
      end
    end
  end
end

require 'druid/elements/element'
require 'druid/elements/ordered_list'
require 'druid/elements/unordered_list'
require 'druid/elements/table'
require 'druid/elements/table_row'
require 'druid/elements/select_list'
require 'druid/elements/link'
require 'druid/elements/button'
require 'druid/elements/check_box'
require 'druid/elements/radio_button'
require 'druid/elements/text_field'
require 'druid/elements/div'
require 'druid/elements/table_cell'
require 'druid/elements/image'
require 'druid/elements/span'
require 'druid/elements/hidden_field'
require 'druid/elements/list_item'
require 'druid/elements/text_area'
require 'druid/elements/form'
require 'druid/elements/option'
require 'druid/elements/heading'
require 'druid/elements/paragraph'
require 'druid/elements/file_field'
require 'druid/elements/label'
require 'druid/elements/area'
require 'druid/elements/canvas'
require 'druid/elements/media'
require 'druid/elements/audio'
require 'druid/elements/video'
require 'druid/elements/bold'
require 'druid/elements/italic'

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
druid-s-1.0.0 lib/druid/elements.rb
druid-ts-1.2.6 lib/druid/elements.rb
druid-ts-1.2.5 lib/druid/elements.rb
druid-ts-1.2.4 lib/druid/elements.rb
druid-ts-1.2.3 lib/druid/elements.rb
druid-ts-1.2.2 lib/druid/elements.rb
druid-ts-1.2.1 lib/druid/elements.rb