Skip to content

Commit

Permalink
Change local variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
yulii committed Sep 19, 2016
1 parent fd72b8d commit 58b9a6f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/mixin/enum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def self.included(klass)
end

module ClassMethods
def enumerated(*args, &block)
unite FactorFactory.create(*args, &block)
def enumerated(*members, &block)
unite FactorFactory.create(*members, &block)
freeze
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/mixin/enum/factor/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module Mixin
module Enum
module Factor
class Struct < Base
def initialize(*attributes)
@struct_class = ::Struct.new(*attributes)
def initialize(*members)
@struct_class = ::Struct.new(*members)
super()
end

Expand Down
8 changes: 4 additions & 4 deletions lib/mixin/enum/factor_factory.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Mixin
module Enum
class FactorFactory
def self.create(*args, &block)
build(*args).tap do |f|
def self.create(*members, &block)
build(*members).tap do |f|
f.instance_eval(&block)
end
end

def self.build(*args)
args.empty? ? Factor::Object.new : Factor::Struct.new(*args)
def self.build(*members)
members.empty? ? Factor::Object.new : Factor::Struct.new(*members)
end

private_class_method :new, :allocate, :build
Expand Down

0 comments on commit 58b9a6f

Please sign in to comment.