Skip to content

Commit

Permalink
Making Rubocop happy about extending Struct.new
Browse files Browse the repository at this point in the history
What's so wrong about that anyway????
  • Loading branch information
bethesque committed Feb 13, 2015
1 parent ae0a4a9 commit fec3706
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion spec/autoloaded/instance_struct.rb
@@ -1,5 +1,6 @@
module Autoloaded
class InstanceStruct < ::Struct.new(nil)
InstanceStruct = ::Struct.new(nil)
class InstanceStruct
def perform
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/autoloaded/struct.rb
@@ -1,6 +1,7 @@
# Make sure this file does not get required manually
module Autoloaded
class Struct < ::Struct.new(nil)
Struct = ::Struct.new(nil)
class Struct
def perform
end
end
Expand Down
6 changes: 4 additions & 2 deletions spec/sample_jobs.rb
@@ -1,4 +1,5 @@
class NamedJob < Struct.new(:perform)
NamedJob = Struct.new(:perform)
class NamedJob
def display_name
'named_job'
end
Expand Down Expand Up @@ -26,7 +27,8 @@ def perform
end
end

class CustomRescheduleJob < Struct.new(:offset)
CustomRescheduleJob = Struct.new(:offset)
class CustomRescheduleJob
cattr_accessor :runs
@runs = 0
def perform
Expand Down

0 comments on commit fec3706

Please sign in to comment.