Source

RubyCSharp / Dynamic / ruby_dynamic / customer.rb

Full commit

class DynamicEntity

  attr_reader :additional_data

  def initialize(additional_data)
      @additional_data = additional_data
  end
  
  def method_missing(name, *args)

      if name =~ /=$/
        self.additional_data[name.to_s.gsub("=", "")] = args[0]
      else
        self.additional_data[name] 
      end
  end

  def respond_to(name)
    raise self.additional_data.inspect
    self.additional_data.include?(name)
  end
end

class Customer < DynamicEntity
    attr_accessor :first_name, :list_name

end