Class: Seedify::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/seedify/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextObject (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, message, &block)
  process_items(array, array.length, message, &block)
end

#line(message, &block) ⇒ Object



9
10
11
12
13
# File 'lib/seedify/logger.rb', line 9

def line(message, &block)
  print "#{name} #{formatted_message message}"
  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, message, &block)
  process_items(count.times.to_a, count, message, &block)
end