From a08e55b7dee696aa403a75d67e06728fee2f427c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 1 Oct 2018 20:04:19 +0200 Subject: Replace tabs, whitespace only. --- ramaskrik-program.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ramaskrik-program.rb b/ramaskrik-program.rb index c485fce..c2ba006 100644 --- a/ramaskrik-program.rb +++ b/ramaskrik-program.rb @@ -21,20 +21,20 @@ require 'room-schedule' require 'uri' class Movie - attr_reader :title, :link, :start_time, :end_time, :venue + attr_reader :title, :link, :start_time, :end_time, :venue - def initialize(node) - @title = node.css("h4").text.strip + def initialize(node) + @title = node.css("h4").text.strip @link = URI.join("https://ramaskrik.no", node.css("h4 a").attribute('href').value) - @start_time = DateTime.parse(node.css(".date").attribute('title').value) - @end_time = DateTime.parse(@start_time.strftime('%F') + node.css(".prgtype-endTime").text.strip.sub(/\w+/, '')) - @end_time += 1 if @end_time < @start_time - @venue = node.css(".place").text.strip - end - - def to_s - "#{title} #{start_time} - #{end_time}, #{venue}" - end + @start_time = DateTime.parse(node.css(".date").attribute('title').value) + @end_time = DateTime.parse(@start_time.strftime('%F') + node.css(".prgtype-endTime").text.strip.sub(/\w+/, '')) + @end_time += 1 if @end_time < @start_time + @venue = node.css(".place").text.strip + end + + def to_s + "#{title} #{start_time} - #{end_time}, #{venue}" + end end doc = Nokogiri::HTML(open("https://ramaskrik.no/program/")) -- cgit v1.2.3