Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/hermeneutics/color.rb,
lib/hermeneutics/message.rb

Direct Known Subclasses

Hermeneutics::Id, Hermeneutics::PlainText

Instance Method Summary collapse

Instance Method Details

#eat_linesObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/hermeneutics/message.rb', line 17

def eat_lines
  @pos ||= 0
  while @pos < length do
    p = index /.*\n?/, @pos
    l = $&.length
    begin
      yield self[ @pos, l]
    ensure
      @pos += l
    end
  end
end

#rewindObject



29
30
31
# File 'lib/hermeneutics/message.rb', line 29

def rewind
  @pos = 0
end

#to_grayObject Also known as: to_grey



258
259
260
# File 'lib/hermeneutics/color.rb', line 258

def to_gray
  (Integer self).to_gray
end

#to_rgbObject



262
263
264
# File 'lib/hermeneutics/color.rb', line 262

def to_rgb
  Hermeneutics::Color.from_s self
end