Module: Craig::Node::Age

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

Instance Method Summary collapse

Instance Method Details

#ageInt

The poster’s age. Coerced to 0 if it is missing so that listings can be sorted.

Returns:

  • (Int)


77
78
79
# File 'lib/craig/node.rb', line 77

def age
  dom.at_css("a").text[/- (\d+)$/, 1].to_i
end