Class: DayOneKindle::ClippingsParser

Inherits:
Object
  • Object
show all
Defined in:
lib/dayone-kindle/clippings_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ ClippingsParser

Returns a new instance of ClippingsParser.



5
6
7
# File 'lib/dayone-kindle/clippings_parser.rb', line 5

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



3
4
5
# File 'lib/dayone-kindle/clippings_parser.rb', line 3

def raw
  @raw
end

Instance Method Details

#highlightsObject



9
10
11
12
13
# File 'lib/dayone-kindle/clippings_parser.rb', line 9

def highlights
  raw.split("\n==========\n").map do |r|
    ClippingParser.new(r).highlight
  end.compact
end