Permalink
Browse files

Correct Proprerty callbacks

  • Loading branch information...
jhchabran committed Jul 20, 2012
1 parent 3250b36 commit c86766eac00f6fa571b71774c5c3cd1165d9873f
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/vintner/property.rb
View
@@ -9,11 +9,19 @@ def initialize name, &block
end
def import model, value
- yield mode, value
+ if setter_defined?
+ @setter.call mode, value
+ else
+ model.send "#{name}=", value
+ end
end
def export model
- yield model
+ if getter_defined?
+ @getter.call model
+ else
+ model.send name
+ end
end
def getter_defined?

0 comments on commit c86766e

Please sign in to comment.