famili 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/famili/child.rb CHANGED
@@ -40,23 +40,29 @@ module Famili
40
40
  @model.send("#{name}=", attribute_value)
41
41
  end
42
42
 
43
- def undefine_method_stub(method_name)
44
- munged_name = munge(method_name)
45
- @meta_class.send(:alias_method, method_name, munged_name)
46
- @meta_class.send(:remove_method, munged_name)
47
- end
48
-
49
- alias :undefine_property_stub :undefine_method_stub
50
-
51
43
  def define_property_stub(property_name)
52
44
  define_method_stub property_name do
53
45
  @__famili_child__.resolve_property(property_name)
54
46
  end if @model.respond_to?(property_name)
55
47
  end
56
48
 
49
+ def undefine_property_stub(property_name)
50
+ undefine_method_stub(property_name) if @meta_class.send(:method_defined?, munge(property_name))
51
+ end
52
+
57
53
  def define_method_stub(method_name, &block)
58
54
  @meta_class.send(:alias_method, munge(method_name), method_name)
59
55
  @meta_class.send(:define_method, method_name, &block)
60
56
  end
57
+
58
+ def undefine_method_stub(method_name)
59
+ munged_name = munge(method_name)
60
+ if @meta_class.send(:method_defined?, munged_name)
61
+ @meta_class.send(:alias_method, method_name, munged_name)
62
+ @meta_class.send(:remove_method, munged_name)
63
+ else
64
+ @meta_class.send(:remove_method, method_name)
65
+ end
66
+ end
61
67
  end
62
68
  end
@@ -1,5 +1,5 @@
1
1
  module Famili
2
2
  module Version
3
- STRING = '0.1.5'
3
+ STRING = '0.1.6'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: famili
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -38,7 +38,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  segments:
40
40
  - 0
41
- hash: -1462427138230622600
41
+ hash: -50805093618067577
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
@@ -47,11 +47,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  segments:
49
49
  - 0
50
- hash: -1462427138230622600
50
+ hash: -50805093618067577
51
51
  requirements: []
52
52
  rubyforge_project:
53
53
  rubygems_version: 1.8.10
54
54
  signing_key:
55
55
  specification_version: 3
56
- summary: famili-0.1.5
56
+ summary: famili-0.1.6
57
57
  test_files: []