Sha256: 3ba2c7ca6ff8a2e6babf1283df62ec5ebbeb4723af4a72e3938f5eeaa5118da8

Contents?: true

Size: 266 Bytes

Versions: 7

Compression:

Stored size: 266 Bytes

Contents

module PR
  class BuildFromHash

    def self.[] form, hash
      new(form).from hash
    end

    def initialize form
      @form = form
    end

    def from hash
      hash.each_pair do |key,value|
        @form.send "#{key}=", value
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pr-1.0.0 lib/pr/build_from_hash.rb
pr-0.0.7 lib/pr/build_from_hash.rb
pr-0.0.6 lib/pr/build_from_hash.rb
pr-0.0.5 lib/pr/build_from_hash.rb
pr-0.0.4 lib/pr/build_from_hash.rb
pr-0.0.3 lib/pr/build_from_hash.rb
pr-0.0.2 lib/pr/build_from_hash.rb