Sha256: e5f4ecd16883f710bbf1457afd807f99f996fb2450166a7c3d0c785b858bcef6

Contents?: true

Size: 1.04 KB

Versions: 10

Compression:

Stored size: 1.04 KB

Contents

require 'druid/locator_generator'

module Druid
  module NestedElements

    def self.included(cls)
      Druid::LocatorGenerator.generate_locators(cls)
    end

    private

    def locator(identifier)
      identifier[0] ? identifier[0] : {:index => 0}
    end

    # [:text_field,
    #  :hidden_field,
    #  :text_area,
    #  :select_list,
    #  :link,
    #  :checkbox,
    #  :radio_button,
    #  :button,
    #  :div,
    #  :span,
    #  :table,
    #  :cell,
    #  :image,
    #  :form,
    #  :list_item,
    #  :unordered_list,
    #  :ordered_list,
    #  :h1,
    #  :h2,
    #  :h3,
    #  :h4,
    #  :h5,
    #  :h6,
    #  :paragraph,
    #  :label,
    #  :file_field,
    #  :area,
    #  :canvas,
    #  :audio,
    #  :video].each do |tag|
    #    define_method("#{tag.to_s}_element") do |*identifier|
    #      self.send "#{tag.to_s}_for", locator(identifier)
    #    end
    #
    #    define_method("#{tag.to_s}_elements") do |*identifier|
    #      self.send "#{tag.to_s}s_for", locator(identifier)
    #    end
    #  end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
druid-s-1.0.0 lib/druid/nested_elements.rb
druid-ts-1.2.6 lib/druid/nested_elements.rb
druid-ts-1.2.5 lib/druid/nested_elements.rb
druid-ts-1.2.4 lib/druid/nested_elements.rb
druid-ts-1.2.3 lib/druid/nested_elements.rb
druid-ts-1.2.2 lib/druid/nested_elements.rb
druid-ts-1.2.1 lib/druid/nested_elements.rb
druid-ts-1.2.0 lib/druid/nested_elements.rb
druid-ts-1.1.8 lib/druid/nested_elements.rb
druid-ts-1.1.7 lib/druid/nested_elements.rb