Sha256: fda0dcf906b54d65eb469153206f33151dd3197dd511a7a5e836bb6fd0b2960b

Contents?: true

Size: 268 Bytes

Versions: 3

Compression:

Stored size: 268 Bytes

Contents

class TimeInfoParser

  def initialize(time_element)
    @element = time_element
  end

  def parse
    value           = @element.text.strip.split[0].to_i
    unit_of_measure = @element.text.strip.split[1]
    return TimeInfo.new(value, unit_of_measure)
  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-hackernews-1.1.0 lib/ruby-hackernews/services/parsers/time_info_parser.rb
ruby-hackernews-1.0.1 lib/ruby-hackernews/services/parsers/time_info_parser.rb
ruby-hackernews-1.0.0 lib/HNAPI/services/parsers/time_info_parser.rb