Class: Seedify::Logger
- Inherits:
-
Object
- Object
- Seedify::Logger
- Defined in:
- lib/seedify/logger.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #each(array, message, &block) ⇒ Object
-
#initialize(context) ⇒ Logger
constructor
A new instance of Logger.
- #line(message, &block) ⇒ Object
- #times(count, message, &block) ⇒ Object
Constructor Details
#initialize(context) ⇒ Logger
Returns a new instance of Logger.
5 6 7 |
# File 'lib/seedify/logger.rb', line 5 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/seedify/logger.rb', line 3 def context @context end |
Instance Method Details
#each(array, message, &block) ⇒ Object
15 16 17 |
# File 'lib/seedify/logger.rb', line 15 def each(array, , &block) process_items(array, array.length, , &block) end |
#line(message, &block) ⇒ Object
9 10 11 12 13 |
# File 'lib/seedify/logger.rb', line 9 def line(, &block) print "#{name} #{ }" yield if block_given? print "\n" end |
#times(count, message, &block) ⇒ Object
19 20 21 |
# File 'lib/seedify/logger.rb', line 19 def times(count, , &block) process_items(count.times.to_a, count, , &block) end |