Module: Craig::Node::PostedAt

Included in:
Listing::Base
Defined in:
lib/craig/node.rb

Instance Method Summary collapse

Instance Method Details

#posted_atDate

Returns:

  • (Date)


20
21
22
23
24
25
# File 'lib/craig/node.rb', line 20

def posted_at
  current = dom
  while current = current.previous_element
    return Date.parse(current) if current.name == "h4"
  end
end