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.
273 274 275 |
# File 'lib/bound.rb', line 273 def initialize(receiver) @receiver = receiver end |
Instance Method Details
#seed(hash) ⇒ Object
277 278 279 280 281 282 283 284 285 |
# File 'lib/bound.rb', line 277 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 |