Module: Widgeo::Model
Overview
Work with an entity
Instance Method Summary collapse
-
#initialize(properties) ⇒ Object
Set attributes on the instance.
Instance Method Details
#initialize(properties) ⇒ Object
Set attributes on the instance
7 8 9 10 11 12 13 14 |
# File 'lib/widgeo/model.rb', line 7 def initialize(properties) properties.each do |name, value| # Raise an exception if we don't have a getter for the property raise UndefinedFieldError unless respond_to? name instance_variable_set(:"@#{name}", value) end end |