Class: WhosDatedWho::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/whos_dated_who/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#docObject (readonly)

Returns the value of attribute doc.



3
4
5
# File 'lib/whos_dated_who/parser.rb', line 3

def doc
  @doc
end

Instance Method Details

#parse(body) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/whos_dated_who/parser.rb', line 5

def parse(body)
  @doc = Nokogiri::HTML(body)
  extract_bio
  extract_current_relationship
  # TODO: extract_past_relationships
  @result
end

#resultObject



13
14
15
# File 'lib/whos_dated_who/parser.rb', line 13

def result
  @result ||= Hashie::Mash.new(biography: @biography, status: :unknown)
end