Sha256: b53a68b9b4f37bdf07436d5c1577e2cc4f7fec65aa7645d3d4c3f4d2b29e6084

Contents?: true

Size: 500 Bytes

Versions: 4

Compression:

Stored size: 500 Bytes

Contents

# utf-8

module ONIX
  module Inflector
    
    def initialize(options = {})
      initialize_attributes(options)
    end
    
    def attributes
      public_methods.map {|meth| meth.match(/^(?!roxml|taguri|=)(.+)=$/) ? $1 : nil }.compact
    end
    
    private
    
    def initialize_attributes(options)
      options.symbolize_keys!
      attributes.each do |attribute|
        self.send("#{attribute}=", options[attribute.to_sym]) if options[attribute.to_sym]
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
milkfarm-onix-0.8.13 lib/onix/inflector.rb
milkfarm-onix-0.8.12 lib/onix/inflector.rb
milkfarm-onix-0.8.11 lib/onix/inflector.rb
milkfarm-onix-0.8.10 lib/onix/inflector.rb