Skip to content

Commit 3ae4d4c

Browse files
committed
Fix Rubocop errors
1 parent 0acb5f9 commit 3ae4d4c

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

static_docs/class.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ Classes can include instance methods, class methods, and various types of variab
2424

2525
```ruby
2626
class Product
27+
# rubocop:disable Style/ClassVars
2728
# Class variable (shared across all instances)
2829
@@count = 0
30+
# rubocop:enable Style/ClassVars
2931

32+
# rubocop:disable Style/ClassMethodsDefinitions
3033
# Class method
3134
def self.count
3235
@@count
3336
end
37+
# rubocop:enable Style/ClassMethodsDefinitions
3438

3539
def initialize(name, price)
3640
@name = name
3741
@price = price
42+
# rubocop:disable Style/ClassVars
3843
@@count += 1
44+
# rubocop:enable Style/ClassVars
3945
end
4046

4147
# Instance method

static_docs/defined.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ The `defined?` operator can check various types of expressions and returns diffe
1616
# Checking different types
1717
class Example
1818
CONSTANT = "Hello"
19-
@@class_var = "World"
2019

2120
def check_definitions
2221
@instance_var = "!"
2322

24-
puts defined?(CONSTANT) # Output: constant
25-
puts defined?(@@class_var) # Output: class variable
23+
puts defined?(CONSTANT) # Output: constant
2624
puts defined?(@instance_var) # Output: instance-variable
27-
puts defined?(yield) # Output: yield (if block given)
28-
puts defined?(super) # Output: super (if method has super)
25+
puts defined?(yield) # Output: yield (if block given)
26+
puts defined?(super) # Output: super (if method has super)
2927
end
3028
end
3129

static_docs/else.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ end
1818
The `else` clause can be used with various conditional structures in Ruby.
1919

2020
```ruby
21-
# With unless
21+
# With if (positive condition)
2222
temperature = 25
2323

24-
unless temperature < 20
24+
if temperature >= 20
2525
puts "It's warm"
2626
else
2727
puts "It's cool"

0 commit comments

Comments
 (0)