object_sugar 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/object_sugar/version.rb +1 -1
- data/lib/object_sugar.rb +6 -6
- metadata +2 -2
data/lib/object_sugar/version.rb
CHANGED
data/lib/object_sugar.rb
CHANGED
@@ -83,10 +83,10 @@ module ObjectSugar
|
|
83
83
|
# => ONE, TWO, THREE
|
84
84
|
|
85
85
|
def create_pluralized_constant(name)
|
86
|
-
pluralized = ActiveSupport::Inflector.pluralize(
|
86
|
+
pluralized = ActiveSupport::Inflector.pluralize(name.to_s).upcase.to_sym
|
87
87
|
constants = const_get(name.to_s.camelize.to_sym).constants
|
88
88
|
|
89
|
-
const_set(pluralized, constants)
|
89
|
+
const_set(pluralized, constants)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -112,8 +112,8 @@ module ObjectSugar
|
|
112
112
|
[Class, Module].each do |object|
|
113
113
|
object.class_eval do
|
114
114
|
def value_enums(name, *args)
|
115
|
-
create_enum(
|
116
|
-
create_pluralized_constant(
|
115
|
+
create_enum(name, 1, *args)
|
116
|
+
create_pluralized_constant(name)
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
@@ -126,8 +126,8 @@ module ObjectSugar
|
|
126
126
|
[Class, Module].each do |object|
|
127
127
|
object.class_eval do
|
128
128
|
def bitwise_enums(name, *args)
|
129
|
-
create_enum(
|
130
|
-
create_pluralized_constant(
|
129
|
+
create_enum(name, 2, *args )
|
130
|
+
create_pluralized_constant(name)
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|