national_day_list 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 63cb87e136ef7d1fbb846c9f870a74f0da008878
4
- data.tar.gz: b28f99493a0e3b8173af374d61364f5da6d06ea5
3
+ metadata.gz: c05e9b1feafdd7d74933e3b464ea6da6c24361fb
4
+ data.tar.gz: 972c44fca05b3b60c7d81456666394b68f9e6cca
5
5
  SHA512:
6
- metadata.gz: e52603f9274b94a3ab2c7361b4ea527137ed6c30ee43033bb02d635c57d8e048126c60e0c80a73226a6eead8824b491dd6feae7db962d3250e10974c8c703802
7
- data.tar.gz: 39ac8f911baa40b8eb04e8a79da90971ca6465efa26c63c352fb746c5cc858af5c29891bfd802af32721c1b04a8c04c2a642eebb922d224d0303cc5fdc0b26bc
6
+ metadata.gz: 21cd0bdf8a877cd52a78a08a798511eab2168d18b9aa601a104d26a143a730921c77a4f6d444a7d9ee5302afed69253209e74e4d601454461ef82818840022e4
7
+ data.tar.gz: 8ad23d7b0949c1c91b5b8650091712f70c5805cdf8b127c74be24c46b5c05aed4303ab9d1d853ad5fd7a9dcc144ae615572eaa7b28bb7776515b637d12d77b19
@@ -0,0 +1,24 @@
1
+ class NationalDay
2
+ attr_accessor :name, :url, :summary, :image
3
+ attr_reader :has_details
4
+ def initialize(hash)
5
+ hash.each do |k,v|
6
+ self.send("#{k}=",v)
7
+ end
8
+ @has_details=false
9
+ end
10
+
11
+ #add details from the provided has, if no hash is provided details with automatically be pulled from the url
12
+ #Checkl to see if #has_details is true to avoid excess network requests
13
+ def add_details(hash=Scraper.scrape_day_details(url))
14
+ hash.each do |k,v|
15
+ #tfw you cant check to see if a method is defined with a string, only a symbol
16
+ self.send("#{k}=",v)
17
+ end
18
+ @has_details=true
19
+ end
20
+
21
+ def ==(other)
22
+ name==other.name&&url==other.url&&summary==other.summary&&image==other.image
23
+ end
24
+ end
@@ -5,7 +5,7 @@ class NationalDayList
5
5
  attr_accessor :use_cache
6
6
  MONTHS ||= ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"]
7
7
  URL_BASE ||= "http://www.nationaldaycalendar.com/"
8
- VERSION ||= '1.0.3'
8
+ VERSION ||= '1.0.4'
9
9
 
10
10
  def initialize(use_cache=true)
11
11
  @use_cache = use_cache
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: national_day_list
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Sattelberger
@@ -107,6 +107,7 @@ files:
107
107
  - config/enviroment.rb
108
108
  - lib/cli.rb
109
109
  - lib/dayofmonth.rb
110
+ - lib/nationalday.rb
110
111
  - lib/nationaldaylist.rb
111
112
  - lib/scraper.rb
112
113
  homepage: https://github.com/sattelbergerp/national-day-list