Sha256: 1a0a573d505e0f5001621a6a827ed5c780869f2650ec34951af48bdf73a8ad4d

Contents?: true

Size: 514 Bytes

Versions: 15

Compression:

Stored size: 514 Bytes

Contents

module Vedeu

  # An internal class for Vedeu to provide a consistent interface to
  # options used by many classes.
  #
  class Options

    # @param options [Hash]
    # @param defaults [Hash]
    def initialize(options = {}, defaults = {})
      @options  = options || {}
      @defaults = defaults || {}

      @defaults.merge!(@options).each do |key, value|
        instance_variable_set("@#{key}", value)
        self.class.send(:define_method, key) { value }
      end
    end

  end # Options

end # Vedeu

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vedeu-0.6.30 lib/vedeu/options.rb
vedeu-0.6.29 lib/vedeu/options.rb
vedeu-0.6.28 lib/vedeu/options.rb
vedeu-0.6.27 lib/vedeu/options.rb
vedeu-0.6.26 lib/vedeu/options.rb
vedeu-0.6.25 lib/vedeu/options.rb
vedeu-0.6.24 lib/vedeu/options.rb
vedeu-0.6.23 lib/vedeu/options.rb
vedeu-0.6.22 lib/vedeu/options.rb
vedeu-0.6.21 lib/vedeu/options.rb
vedeu-0.6.20 lib/vedeu/options.rb
vedeu-0.6.19 lib/vedeu/options.rb
vedeu-0.6.18 lib/vedeu/options.rb
vedeu-0.6.17 lib/vedeu/options.rb
vedeu-0.6.16 lib/vedeu/options.rb