Sha256: 9346eff0be0152fd415fd86b486ef15ed77bf00fc4149f7274ce357e86644386

Contents?: true

Size: 425 Bytes

Versions: 14

Compression:

Stored size: 425 Bytes

Contents

# coding: utf-8

module Nephos
  class Params

    def initialize(hash={})
      raise ArgumentError, "the first argument must be a Hash" unless hash.is_a? Hash
      @hash = Hash[hash.map{|k,v| [k.to_s, v]}]
    end

    def method_missing m, *a
      @hash.send(m, *(a.map(&:to_s)))
      @hash.send(m, *a)
    end

    def [] i
      @hash[i.to_s]
    end

    def []= i, v
      @hash[i.to_s] = v.to_s
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
nephos-server-0.5.0 lib/nephos-server/params.rb
nephos-server-0.4.8 lib/nephos-server/params.rb
nephos-server-0.4.7 lib/nephos-server/params.rb
nephos-server-0.4.6 lib/nephos-server/params.rb
nephos-server-0.4.5 lib/nephos-server/params.rb
nephos-server-0.4.4 lib/nephos-server/params.rb
nephos-server-0.4.3 lib/nephos-server/params.rb
nephos-server-0.4.2 lib/nephos-server/params.rb
nephos-server-0.4.1 lib/nephos-server/params.rb
nephos-server-0.4.0 lib/nephos-server/params.rb
nephos-server-0.3.2 lib/nephos-server/params.rb
nephos-server-0.3.1 lib/nephos-server/params.rb
nephos-server-0.2.4 lib/nephos-server/params.rb
nephos-server-0.2.3 lib/nephos-server/params.rb