Class: LinkedIn::Birthdate
- Inherits:
-
Base
- Object
- Base
- LinkedIn::Birthdate
show all
- Defined in:
- lib/linked_in/birthdate.rb
Instance Attribute Summary
Attributes inherited from Base
#doc
Instance Method Summary
collapse
Methods inherited from Base
from_xml, #initialize
Constructor Details
This class inherits a constructor from LinkedIn::Base
Instance Method Details
#day ⇒ Object
8
9
10
|
# File 'lib/linked_in/birthdate.rb', line 8
def day
@day ||= @doc.xpath("/person/date-of-birth/day").text.to_i
end
|
#month ⇒ Object
12
13
14
|
# File 'lib/linked_in/birthdate.rb', line 12
def month
@month ||= @doc.xpath("/person/date-of-birth/month").text.to_i
end
|
#to_date ⇒ Object
16
17
18
|
# File 'lib/linked_in/birthdate.rb', line 16
def to_date
Date.civil(y=year,m=month,d=day)
end
|
#year ⇒ Object
4
5
6
|
# File 'lib/linked_in/birthdate.rb', line 4
def year
@year ||= @doc.xpath("/person/date-of-birth/year").text.to_i
end
|