Skip to content
Browse files

Rename InstanceExtensions to just Extensions

  • Loading branch information...
1 parent 04f8567 commit 023fdeee3e5b536fdd9b0d239db438bd1bf5a9ea @solnic committed Jun 8, 2012
View
5 lib/virtus.rb
@@ -34,8 +34,7 @@ def self.included(object)
# @api private
def self.extended(object)
- object.extend(InstanceExtensions)
- object.extend(InstanceMethods)
+ object.extend(Extensions)
end
private_class_method :extended
@@ -46,7 +45,7 @@ def self.extended(object)
require 'virtus/support/options'
require 'virtus/support/equalizer'
-require 'virtus/instance_extensions'
+require 'virtus/extensions'
require 'virtus/class_inclusions'
require 'virtus/module_extensions'
View
2 lib/virtus/class_methods.rb
@@ -2,7 +2,7 @@ module Virtus
# Class methods that are added when you include Virtus
module ClassMethods
- include InstanceExtensions
+ include Extensions
# Hook called when module is extended
#
View
6 lib/virtus/instance_extensions.rb → lib/virtus/extensions.rb
@@ -1,7 +1,7 @@
module Virtus
- # Instance-level extensions
- module InstanceExtensions
+ # Extensions common for both classes and instances
+ module Extensions
WRITER_METHOD_REGEXP = /=\z/.freeze
INVALID_WRITER_METHODS = %w[ == != === []= attributes= ].to_set.freeze
@@ -73,5 +73,5 @@ def virtus_add_attribute(attribute)
attribute_set << attribute
end
- end # module InstanceExtensions
+ end # module Extensions
end # module Virtus
View
2 ...extensions/allowed_writer_methods_spec.rb → ...extensions/allowed_writer_methods_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Virtus::InstanceExtensions, '#allowed_writer_methods' do
+describe Virtus::Extensions, '#allowed_writer_methods' do
subject { object.allowed_writer_methods }
let(:object) do

0 comments on commit 023fdee

Please sign in to comment.
Something went wrong with that request. Please try again.