Class: DayOneKindle::ClippingsParser
- Defined in:
- lib/dayone-kindle/clippings_parser.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #highlights ⇒ Object
-
#initialize(raw) ⇒ ClippingsParser
constructor
A new instance of ClippingsParser.
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
#raw ⇒ Object (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
#highlights ⇒ Object
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 |