class Medo::Notes

Public Class Methods

new(*args) click to toggle source
# File lib/medo/notes.rb, line 11
def initialize(*args)
  @notes = args.flatten.map { |n| n.to_s.strip }.reject(&:empty?).join("\n")
end

Public Instance Methods

<<(other) click to toggle source
# File lib/medo/notes.rb, line 15
def <<(other)
  @notes << "\n#{other}"
  @notes.lstrip!
end
==(other) click to toggle source
# File lib/medo/notes.rb, line 24
def ==(other)
  return true if other.equal? self
  other.to_s == @notes
end
each() { |chomp| ... } click to toggle source
# File lib/medo/notes.rb, line 20
def each
  @notes.each_line { |line| yield line.chomp }
end
initialize_copy(source) click to toggle source
Calls superclass method
# File lib/medo/notes.rb, line 29
def initialize_copy(source)
  super
  @notes = @notes.dup
end
to_s() click to toggle source
# File lib/medo/notes.rb, line 34
def to_s
  @notes
end