Class: Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/saikuro/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(limit = -1,, error = 11, warn = 8) ⇒ Filter

Returns a new instance of Filter.



4
5
6
7
8
# File 'lib/saikuro/filter.rb', line 4

def initialize(limit = -1, error = 11, warn = 8)
  @limit = limit
  @error = error
  @warn = warn
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



2
3
4
# File 'lib/saikuro/filter.rb', line 2

def error
  @error
end

#limitObject

Returns the value of attribute limit.



2
3
4
# File 'lib/saikuro/filter.rb', line 2

def limit
  @limit
end

#warnObject

Returns the value of attribute warn.



2
3
4
# File 'lib/saikuro/filter.rb', line 2

def warn
  @warn
end

Instance Method Details

#error?(count) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/saikuro/filter.rb', line 18

def error?(count)
  count >= @error
end

#ignore?(count) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/saikuro/filter.rb', line 10

def ignore?(count)
  count < @limit
end

#warn?(count) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/saikuro/filter.rb', line 14

def warn?(count)
  count >= @warn
end