oddx 0.1.4 → 0.1.5

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: eb960e3ecfc08baf0ee3e2b7b1b7da507f8190bb6546d2530cf544c09970338a
4
- data.tar.gz: 8116f4b3bca59a93ec214fc817f7581d7d5730bf59875fd188dc93fbf6cbcdae
3
+ metadata.gz: bab046653c8393c61aa4f329760c817e14a069db277e20c2f4a0b46da4ac62dd
4
+ data.tar.gz: 64346dffe5d3f2e514d9e4e6324a079f4ef464f47d464852eeb6a95667db9607
5
5
  SHA512:
6
- metadata.gz: 4cb9369d8addcfe95ce1966ca580381d7e92baf7f5056e07c1593c771c1945f43ced50d5b35149e215a36563fbdafb996b419f18344a7cf01338a3c5dbea454d
7
- data.tar.gz: efa12e6797e580bdbd62b748cd985a591d19de2488036a0b0eea1155792dc2f32deab4cfd286b48e4cb9254b459886e043f55246e8e494d5e28ff22fab86467b
6
+ metadata.gz: a68766deee6255964f26e74a75843c610c91aeced7f09f1bec27cc928140bd954c118a9d0fd0a1d398fd14ac8d616f4d58a46de174c6b95037df23f83c143a68
7
+ data.tar.gz: 8bc9cc5a0a60408d886f72599b2232b4b3bc10c6c60e2075a276cf59f73cbcf8d76e995ad26a26404641c8e124046e102fc445f5eb36e1912f41ad649d13303c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oddx (0.1.4)
4
+ oddx (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "odds"
4
-
5
3
  module Oddx
6
- class DecimalOdds < Oddx::Odds
4
+ class DecimalOdds < Odds
7
5
  REGEX = /^(?<val>\d*\.?\d+$)/
8
6
 
9
7
  def initialize(odds)
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "odds"
4
-
5
3
  module Oddx
6
- class FractionalOdds < Oddx::Odds
4
+ class FractionalOdds < Odds
7
5
  REGEX = /^(?<num>\d+)\/(?<den>\d+)$/
8
6
 
9
7
  def initialize(odds)
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "odds"
4
-
5
3
  module Oddx
6
- class MoneylineOdds < Oddx::Odds
4
+ class MoneylineOdds < Odds
7
5
  REGEX = /^(?<mod>\+|-)(?<value>\d+\.?\d+)$/
8
6
 
9
7
  def initialize(odds)
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "odds"
4
-
5
3
  module Oddx
6
- class ProbabilityOdds < Oddx::Odds
4
+ class ProbabilityOdds < Odds
7
5
  REGEX = /^(?<value>\d+\.?\d+)?%/
8
6
 
9
7
  def initialize(odds)
data/lib/oddx/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Oddx
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/oddx.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "oddx/version"
4
+ require_relative "oddx/odds"
4
5
  require_relative "oddx/decimal_odds"
5
6
  require_relative "oddx/fractional_odds"
6
7
  require_relative "oddx/moneyline_odds"
@@ -29,10 +30,10 @@ module Oddx
29
30
  # 4. probability (e.g. 95%, 30%)
30
31
 
31
32
  ODDS_FORMATS = [
32
- Oddx::FractionalOdds,
33
- Oddx::MoneylineOdds,
34
- Oddx::DecimalOdds,
35
- Oddx::ProbabilityOdds
33
+ FractionalOdds,
34
+ MoneylineOdds,
35
+ DecimalOdds,
36
+ ProbabilityOdds
36
37
  ]
37
38
 
38
39
  def self.parse(odds)
@@ -43,8 +44,8 @@ module Oddx
43
44
  end
44
45
  end
45
46
  rescue NoMethodError
46
- raise Oddx::OddxError.new(msg: "Error parsing odds, provide as String to avoid ambiguity. e.g: '+4000'", odds: odds)
47
+ raise OddxError.new(msg: "Error parsing odds, provide as String to avoid ambiguity. e.g: '+4000'", odds: odds)
47
48
  end
48
- raise Oddx::OddxError.new(odds: odds)
49
+ raise OddxError.new(odds: odds)
49
50
  end
50
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - irishbryan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-16 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -56,5 +56,5 @@ requirements: []
56
56
  rubygems_version: 3.3.26
57
57
  signing_key:
58
58
  specification_version: 4
59
- summary: Convert sporting odds to any format.
59
+ summary: Convert sports betting odds to any format (e.g. 3/1 » +300).
60
60
  test_files: []