Class: Everlog::Dom::Value::Hatena

Inherits:
Everlog::Dom::Value show all
Includes:
Maybe
Defined in:
lib/everlog/dom/value/hatena.rb

Instance Method Summary collapse

Methods included from Maybe

#maybe

Methods inherited from Everlog::Dom::Value

#initialize, #parse_to_His

Constructor Details

This class inherits a constructor from Everlog::Dom::Value

Instance Method Details

#issuedObject



13
14
15
16
17
18
# File 'lib/everlog/dom/value/hatena.rb', line 13

def issued
  row_string = maybe(@response['issued']).to_s
  DateTime.parse(row_string).to_time
rescue ArgumentError
  Time.parse('00:00:00')
end


9
10
11
# File 'lib/everlog/dom/value/hatena.rb', line 9

def link
  @response['link'].first['href']
end

#titleObject



5
6
7
# File 'lib/everlog/dom/value/hatena.rb', line 5

def title
  maybe(@response['title']).to_s
end