Class: SeedsHelper::Stats

Inherits:
Struct
  • Object
show all
Defined in:
/var/apps/qpixel/app/helpers/seeds_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#createdObject

Returns the value of attribute created

Returns:

  • (Object)

    the current value of created



38
39
40
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 38

def created
  @created
end

#erroredObject

Returns the value of attribute errored

Returns:

  • (Object)

    the current value of errored



38
39
40
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 38

def errored
  @errored
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



38
39
40
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 38

def skipped
  @skipped
end

#updatedObject

Returns the value of attribute updated

Returns:

  • (Object)

    the current value of updated



38
39
40
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 38

def updated
  @updated
end

Instance Method Details

#<<(other) ⇒ Object



45
46
47
48
49
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 45

def <<(other)
  members.each do |member|
    send("add_#{member}", other[member])
  end
end


51
52
53
54
55
# File '/var/apps/qpixel/app/helpers/seeds_helper.rb', line 51

def print
  members.map { |m| self[m]&.positive? ? "#{m} #{self[m]}" : nil }
         .compact
         .join(', ')
end