Sha256: 6bc1eb4be62e1ac8c0ae3b833d530d712f0f5085973ce7a826540d6c302ca510

Contents?: true

Size: 520 Bytes

Versions: 104

Compression:

Stored size: 520 Bytes

Contents

module ZTK::DSL::Core

  # @author Zachary Patten <zachary AT jovelabs DOT com>
  # @api private
  module Options

    def self.included(base)
      base.class_eval do
        base.send(:extend, ZTK::DSL::Core::Options::ClassMethods)
      end
    end

    # @author Zachary Patten <zachary AT jovelabs DOT com>
    module ClassMethods

      def add_option(key)
        option_key = "#{key}_options"
        cattr_accessor option_key
        send(option_key) || send("#{option_key}=", {})
      end

    end

  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
ztk-3.1.0 lib/ztk/dsl/core/options.rb
ztk-3.0.4 lib/ztk/dsl/core/options.rb
ztk-3.0.3 lib/ztk/dsl/core/options.rb
ztk-3.0.2 lib/ztk/dsl/core/options.rb
ztk-3.0.1 lib/ztk/dsl/core/options.rb
ztk-3.0.0 lib/ztk/dsl/core/options.rb
ztk-2.4.2 lib/ztk/dsl/core/options.rb
ztk-2.4.1 lib/ztk/dsl/core/options.rb
ztk-2.4.0 lib/ztk/dsl/core/options.rb
ztk-2.3.1 lib/ztk/dsl/core/options.rb
ztk-2.3.0 lib/ztk/dsl/core/options.rb
ztk-2.2.0 lib/ztk/dsl/core/options.rb
ztk-2.1.1 lib/ztk/dsl/core/options.rb
ztk-2.1.0 lib/ztk/dsl/core/options.rb
ztk-2.0.1 lib/ztk/dsl/core/options.rb
ztk-2.0.0 lib/ztk/dsl/core/options.rb
ztk-1.19.2 lib/ztk/dsl/core/options.rb
ztk-1.19.1 lib/ztk/dsl/core/options.rb
ztk-1.19.0 lib/ztk/dsl/core/options.rb
ztk-1.18.5 lib/ztk/dsl/core/options.rb