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.16.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.15.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.14.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.13.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.13.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.12.2 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.12.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.12.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.11.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.10.1.beta.2 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.10.1.beta.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.10.1.beta.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.10.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.9.1 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.9.0 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.8.9 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.8.8 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.8.7 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.8.6 app/components/coco/concerns/accepts_options.rb
coveragebook_components-0.8.5 app/components/coco/concerns/accepts_options.rb