Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify AccessorMethod using AbstractType

  • Loading branch information...
commit 6aeed73c75f9fa6b0ecfd73d5b262024386d69ea 1 parent c2a4770
@solnic authored
View
1  lib/virtus.rb
@@ -47,6 +47,7 @@ def self.coercer(&block)
end # module Virtus
+require 'abstract_type'
require 'descendants_tracker'
require 'adamantium'
require 'coercible'
View
26 lib/virtus/attribute/accessor_method.rb
@@ -9,6 +9,12 @@ class Attribute
class AccessorMethod
include Adamantium::Flat
+ include AbstractType
+
+ abstract_method :call
+
+ abstract_method :define_method
+
# Return name
#
# @return [Symbol]
@@ -54,26 +60,6 @@ def public?
visibility == :public
end
- # Call this method
- #
- # @abstract
- #
- # @api public
- def call(*)
- raise NotImplementedError
- end
-
- # Define method via provided module
- #
- # @param [Accessor] accessor
- #
- # @param [AttributeSet] mod
- #
- # @api private
- def define_method(accessor, mod)
- raise NotImplementedError
- end
-
end # class AccessorMethod
end # class Attribute
View
1  virtus.gemspec
@@ -17,6 +17,7 @@ Gem::Specification.new do |gem|
gem.extra_rdoc_files = %w[LICENSE README.md TODO.md]
gem.add_dependency('backports', [ '~> 3.0', '>= 3.1.0' ])
+ gem.add_dependency('abstract_type', '~> 0.0.5')
gem.add_dependency('descendants_tracker', '~> 0.0.1')
gem.add_dependency('adamantium', '~> 0.0.7')
gem.add_dependency('coercible', '~> 0.2')
Please sign in to comment.
Something went wrong with that request. Please try again.