random_yesno 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/random_yesno.rb +15 -0
  3. metadata +42 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3d0571ccb74e305b920a551cbfc38be6be94017e8e2607e0dad5323bd6c99b8b
4
+ data.tar.gz: 43c91d5f74d7deaad58a1eecd4b019e20eb026492e9a59d6047c64be9d1041c8
5
+ SHA512:
6
+ metadata.gz: cf556cd3908ee87cdce571df1346878a9e4e007013f77a537009031c32b99daff8493dc18f73af12bd671164338eeeacabd54d282bf4844920aa3b52d052b864
7
+ data.tar.gz: 3f9f5e660f3d985f671d9c406a4da492f64eb29e845b163d8503fa401df17f6e0957fc6d7de413175e980d45bab1465072d9db632353a3e076e109440a6c7684
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'uri'
4
+ require 'net/http'
5
+ require 'json'
6
+
7
+ # RandomYesNo class
8
+ class RandomYesNo
9
+ URI = URI('https://yesno.wtf/api')
10
+
11
+ def self.show
12
+ res = Net::HTTP.get_response(URI)
13
+ JSON.parse(res.body) if res.is_a?(Net::HTTPSuccess)
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,42 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: random_yesno
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Trang Tung Nguyen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-11-15 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Generates random yes/no gifs in json format
14
+ email: tungtrangn@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/random_yesno.rb
20
+ homepage: https://i-love-ruby.gitlab.io
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: '3.1'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubygems_version: 3.3.7
39
+ signing_key:
40
+ specification_version: 4
41
+ summary: Generates random yes/no gifs
42
+ test_files: []