Class: Bound::HashSeeder
- Inherits:
-
Object
- Object
- Bound::HashSeeder
- Defined in:
- lib/bound.rb
Instance Method Summary collapse
-
#initialize(receiver) ⇒ HashSeeder
constructor
A new instance of HashSeeder.
- #seed(hash) ⇒ Object
Constructor Details
#initialize(receiver) ⇒ HashSeeder
Returns a new instance of HashSeeder.
265 266 267 |
# File 'lib/bound.rb', line 265 def initialize(receiver) @receiver = receiver end |
Instance Method Details
#seed(hash) ⇒ Object
269 270 271 272 273 274 275 276 277 |
# File 'lib/bound.rb', line 269 def seed(hash) hash.each do |key, value| attribute = @receiver.get_attribute(key) next if attribute && attribute.is_assigned? method = "#{key}=" @receiver.send method, value end end |