Sha256: e71fada0506b66638a384b58f262577f86aa475e347b321092a9ba30de77a2f1

Contents?: true

Size: 669 Bytes

Versions: 73

Compression:

Stored size: 669 Bytes

Contents

module Coco
  module Concerns
    module AcceptsOptions
      extend ActiveSupport::Concern

      delegate :get_option_value,
        :set_option_value,
        :option_value_equals?,
        :get_option,
        :merge_option_values,
        :option_names,
        to: :accepted_options

      def get_option_group(...)
        accepted_options.get_group(...)
      end

      def accepted_options
        @_accepted_options ||= self.class.option_group.clone
      end

      class_methods do
        delegate :accepts_option, to: :option_group

        def option_group
          @_options ||= Coco::Options::Group.new(:root)
        end
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
coveragebook_components-0.19.8 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.7 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.6 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.5 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.4 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.3 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.2 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.19.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.18.8 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.18.7 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.18.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.7 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.6 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.5 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.4 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.3 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.2 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.17.0 app/components/coco/concerns/accepts_options.rb