Sha256: 08907dd6eef31572ec96086b1589924a99e616c9083a6a2d4b7c33bab161f71a

Contents?: true

Size: 760 Bytes

Versions: 2

Compression:

Stored size: 760 Bytes

Contents

module PageEz
  module MethodGenerators
    class HasOneStaticSelector
      attr_reader :selector

      def initialize(name, selector, dynamic_options, options, &block)
        @name = name
        @selector = selector
        @evaluator_class = SelectorEvaluator.build(name, dynamic_options: dynamic_options, options: options, selector: selector)
        @block = block
      end

      def run(target)
        constructor = target.constructor_from_block(&@block)

        DefineHasOneResultMethods.new(@name, evaluator_class: @evaluator_class, constructor: constructor).run(target)
        DefineHasOnePredicateMethods.new(@name, evaluator_class: @evaluator_class).run(target)
      end

      def selector_type
        :static
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
page_ez-0.2.0 lib/page_ez/method_generators/has_one_static_selector.rb
page_ez-0.1.0 lib/page_ez/method_generators/has_one_static_selector.rb