fact_is_fact 1.2.0 → 1.2.1

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
  SHA256:
3
- metadata.gz: 69a0dd40312fe67715cc1fb0c320a5817af3ef1a91ad418dd3eb853bad7b38f3
4
- data.tar.gz: fc2349cf4821ee2d9dc2102252efde16125b9571cd55b14f0f5341c803fcde2b
3
+ metadata.gz: e0669d6d8cc1793530b82447f4a2e1e897630cf30aa109fee1db3b851fcfb610
4
+ data.tar.gz: 700807423e7dc236871ab2e3eb70c72abe20cae79e7bb15d72e73b3180c01bb7
5
5
  SHA512:
6
- metadata.gz: e707f597b4de921eef72a66fe82a3b1f11081ad4cbb2d0d03a21a1724658bc187e3fe992824b628b5ca6a3df1559b7ce2d98891600e9d5c7e109437508e4a753
7
- data.tar.gz: cdf18cdb1d573a465f8654c7e57d46d38efd5bcffee594bf0b1d39a060e5573dac0a2a3b6b80b0973a9f1b9578bb035fce4e104b026e4c3e6541b0ed51d36412
6
+ metadata.gz: a57fbde7abf78ee497cc35f570f6061e07cc288ec1103529c957e15ae2531b2cb5728809db70dbc3c9aed97753c330ce5b06973e86b64bbaf5d0c1a01c0e6af2
7
+ data.tar.gz: aec7f4ffd41e7febd7908b5d3c8a9d23fbca1660b770e4a8d90287a46652e197a9bbd5a1963e110096896bc5d7e6402cbab24b05a5c516d6a4dcd733489a2e14
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## Version 1.2.1
2
+ Documentation for batch request
3
+
1
4
  ## Version 1.1.0
2
5
  Ability to pass optional params with the request
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fact_is_fact (1.2.0)
4
+ fact_is_fact (1.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -32,4 +32,4 @@ DEPENDENCIES
32
32
  rspec (= 3.10.0)
33
33
 
34
34
  BUNDLED WITH
35
- 2.2.17
35
+ 2.2.19
data/README.md CHANGED
@@ -103,7 +103,7 @@ FactIsFact.return(type: 'math', number: '123123123', default: 'no facts found')
103
103
  #=> "no facts found"
104
104
  ```
105
105
 
106
- ## MIN AND MAX
106
+ ### MIN AND MAX
107
107
  Restrict the range of values returned to the inclusive range [min, max] when random is given as the number.
108
108
 
109
109
  ```ruby
@@ -111,6 +111,27 @@ FactIsFact.return(type: 'trivia', number: 'random', min: 10, max: 20)
111
111
  #=> "16 is the number of personality types in the Myers-Briggs classification system."
112
112
  ```
113
113
 
114
+ ### BATCH REQUESTS
115
+ To get facts about multiple numbers in one request, specify ranges for number.
116
+
117
+ A number range (inclusive) is specified as min..max. Separate multiple ranges and individual numbers with , (a comma).
118
+
119
+ The response format will always be a JSON map from numbers to facts, of at most 100 numbers. The query parameter json may still be used to specify whether individual facts will be returned as string literals or JSON objects.
120
+
121
+ ```ruby
122
+ FactIsFact.return(type: 'math', number: '1..3', json: '')
123
+ => "{\n \"1\": \"1 is the most common leading digit in many sets of data, a consequence of Benford's law.\",\n \"2\": \"2 is a primorial, as well as its own factorial.\",\n \"3\": \"3 is the fourth open meandric number.\"\n}"
124
+
125
+ FactIsFact.return(type: 'math', number: '1..3,10,13,15', json: '')
126
+ => "{\n \"1\": \"1 is also the first and second numbers in the Fibonacci sequence and is the first number in many other mathematical sequences.\",\n \"2\": \"2 is the number of n-Queens Problem solutions for n = 4.\",\n \"3\": \"3 is the first unique prime due to the properties of its reciprocal.\",\n \"10\": \"10 is the aliquot sum of only one number the discrete semiprime 14.\",\n \"13\": \"13 is the number of Archimedian solids.\",\n \"15\": \"15 is a triangular number, a hexagonal number, a pentatope number and the 4th Bell number.\"\n}"
127
+
128
+ FactIsFact.return(type: 'year', number: '1..3,10,13,15', json: '')
129
+ => "{\n \"1\": \"1 is the year that Emperor Ping of Han China begins his reign and Wang Mang is re-instated as regent by Grand Empress Dowager Wang.\",\n \"2\": \"2 is the year that Cedeides becomes Archon of Athens.\",\n \"3\": \"3 is the year that Augustus adopts his grandson, Gaius Caesar, with the expectation that he will succeed him.\",\n \"10\": \"10 is the year that Ovid completes Tristia (the \\\"Sorrows\\\", 5 books) and Epistulae ex Ponto (Letters from the Black Sea, 4 books) describing the sadness of banishment.\",\n \"13\": \"13 is the year that Strabo publishes his book on the shape of the Earth.\",\n \"15\": \"15 is the year that Germanicus captures Thusnelda, the wife of Arminius.\"\n}"
130
+ ```
131
+
132
+
133
+
134
+
114
135
  ## Development
115
136
 
116
137
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/lib/version.rb CHANGED
@@ -1 +1 @@
1
- VERSION = '1.2.0'.freeze
1
+ VERSION = '1.2.1'.freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fact_is_fact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhinay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-25 00:00:00.000000000 Z
11
+ date: 2021-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.1.2
99
+ rubygems_version: 3.1.6
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: This gem allows users to get a random trivia about a number or date or a