Sha256: e5a534b83006f09f28ae3bc6aa23f253ac8f75627ae5a1b286a10bb9e0bb9d7e
Contents?: true
Size: 511 Bytes
Versions: 11
Compression:
Stored size: 511 Bytes
Contents
# frozen_string_literal: true module AstrologicalForecast module Introduction def self.init(vars) html = URI.parse(::BASE_URL).read document = Nokogiri::HTML(html) zodiac = document.css('div.main ul > li')[vars[:number].to_i - 1] { name: zodiac.at('a .name').text, date: zodiac.at('a .per').text, head: zodiac.css(".ico-#{vars[:name_en]}") .text.strip.gsub(/\s{2,}/, ', ') .split(', ')[2] } end end end
Version data entries
11 entries across 11 versions & 1 rubygems