lib/ruskino33_parser/announce.rb in ruskino33_parser-0.1.1 vs lib/ruskino33_parser/announce.rb in ruskino33_parser-0.1.2

- old
+ new

@@ -1,11 +1,10 @@ module Ruskino33Parser class Announce - attr_accessor :url, :doc + attr_accessor :url, :doc, :date - # date: '2015-03-11' def initialize(attributes = {}) - date = attributes[:date].nil? ? Date.today : Date.parse(attributes[:date].to_s) + @date = attributes[:date].nil? ? Date.today : Date.parse(attributes[:date].to_s) params = { action: :anonce, date: date.strftime("%d.%m.%Y") } @url = "http://www.ruskino33.ru/cgi-bin/webkino2/webkino.pl?#{URI.encode_www_form(params)}" @doc = Nokogiri::HTML(File.open('./spec/factories/anonce.html')) if attributes[:test] == true end