sportdb-market 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ lib/sportdb/market/market.rb
18
18
  lib/sportdb/market/models/event_quote.rb
19
19
  lib/sportdb/market/models/game.rb
20
20
  lib/sportdb/market/models/group_quote.rb
21
+ lib/sportdb/market/models/quote.rb
21
22
  lib/sportdb/market/models/service.rb
22
23
  lib/sportdb/market/reader.rb
23
24
  lib/sportdb/market/schema.rb
@@ -70,6 +70,6 @@ module SportDB::Market
70
70
  end # method delete!
71
71
 
72
72
  puts "SportDB::Market.banner: >>#{SportDB::Market.banner}<<"
73
- puts "SportDB::Market.root: >>#{SportDB::Market.root}<<"
73
+ ## puts "SportDB::Market.root: >>#{SportDB::Market.root}<<"
74
74
 
75
75
  end # module SportDB::Market
@@ -0,0 +1,35 @@
1
+ ## NB: just use namespace SportDB::Models (not SportDB::Models::Market)
2
+
3
+ module SportDB::Models
4
+
5
+ class Quote < ActiveRecord::Base
6
+
7
+ belongs_to :service
8
+ belongs_to :game
9
+
10
+ def self.create_from_ary!( games_with_odds, service )
11
+ games_with_odds.each do |values|
12
+ Quote.create!(
13
+ :service => service,
14
+ :game => values[0],
15
+ :odds1 => values[1],
16
+ :oddsx => values[2],
17
+ :odds2 => values[3])
18
+ end # each games
19
+ end
20
+
21
+ def self.create_from_ary_for_round!( games_with_odds, service, round )
22
+ games_with_odds.each do |values|
23
+ Quote.create!(
24
+ :service => service,
25
+ :game => Game.find_by_round_id_and_team1_id_and_team2_id!( round.id, values[0].id, values[1].id),
26
+ :odds1 => values[2],
27
+ :oddsx => values[3],
28
+ :odds2 => values[4])
29
+ end # each games
30
+ end
31
+
32
+
33
+ end # class Quote
34
+
35
+ end # module SportDB::Models
@@ -2,5 +2,5 @@
2
2
  module SportDB ; end # forward reference (for hoe require)
3
3
 
4
4
  module SportDB::Market
5
- VERSION = '0.0.7'
5
+ VERSION = '0.0.8'
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-market
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gerald Bauer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-11-13 00:00:00 Z
18
+ date: 2012-11-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rdoc
@@ -83,6 +83,7 @@ files:
83
83
  - lib/sportdb/market/models/event_quote.rb
84
84
  - lib/sportdb/market/models/game.rb
85
85
  - lib/sportdb/market/models/group_quote.rb
86
+ - lib/sportdb/market/models/quote.rb
86
87
  - lib/sportdb/market/models/service.rb
87
88
  - lib/sportdb/market/reader.rb
88
89
  - lib/sportdb/market/schema.rb