Skip to content

Commit d0830a2

Browse files
committed
rubocop fixes
1 parent e681224 commit d0830a2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/picrate/helper_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def blend_color(c1, c2, mode)
110110
# Here's a convenient way to look for them.
111111
def find_method(method_name)
112112
reg = Regexp.new(method_name.to_s, true)
113-
methods.sort.select { |meth| reg.match(meth) }
113+
methods.sort.select { |meth| reg.match?(meth) }
114114
end
115115

116116
# Proxy over a list of Java declared fields that have the same name as

library/boids/boids.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Boids
7979
extend Forwardable
8080
def_delegators(:@boids, :reject, :<<, :each, :shuffle!, :length, :next)
8181

82-
attr_reader :has_goal, :perch, :perch_tm, :perch_y
82+
attr_reader :has_goal, :perchance, :perch_tm, :perch_y
8383

8484
def initialize
8585
@boids = []
@@ -104,7 +104,7 @@ def setup(n, x, y, w, h)
104104
@scatter = 0.005
105105
@scatter_time = 50.0
106106
@scatter_i = 0.0
107-
@perch = 1.0 # Lower this number to divebomb.
107+
@perchance = 1.0 # Lower this number to divebomb.
108108
@perch_y = h
109109
@perch_tm = -> { 25.0 + rand(50.0) }
110110
@has_goal = false
@@ -125,11 +125,11 @@ def no_scatter
125125
def perch(ground = nil, chance = 1.0, frames = nil)
126126
@perch_tm = frames.nil? ? -> { 25.0 + rand(50.0) } : frames
127127
@perch_y = ground.nil? ? @h : ground
128-
@perch = chance
128+
@perchance = chance
129129
end
130130

131131
def no_perch
132-
@perch = 0.0
132+
@perchance= 0.0
133133
end
134134

135135
def reset_goal(target)

0 commit comments

Comments
 (0)