Sha256: 449e6a7830191d823fa34bd71ea6fe305e6fde80171ed6c69acf861b6c3a7dab

Contents?: true

Size: 460 Bytes

Versions: 2

Compression:

Stored size: 460 Bytes

Contents

require 'sham/config/base'
require 'sham/util'

module Sham
  class Config
    class Attributes < Base
      def initialize(config)
        @config = config
      end

      def options(*args)
        @options = ::Sham::Util.extract_options!(args)

        @config.call.each do |key, value|
          @options[key] = parse!(value) unless @options.has_key?(key)
        end

        self
      end

      def args
        [@options]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sham-1.1.0 lib/sham/config/attributes.rb
sham-1.0.3 lib/sham/config/attributes.rb