iron_warbler 2.0.7.16 → 2.0.7.18

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 +4 -4
  2. data/app/models/iro/alert.rb +6 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18954e909b6d16fbfd4f1edaede8493c0a011308febb3c37ad3e539a6d4d78b0
4
- data.tar.gz: 22b2c2e0cd159318cfb8f674aafecdcf70640fabf42872b72b839fcde1ebd099
3
+ metadata.gz: b6b3c19fdfe0c9cd47b253a92b6065f067d3004022865d700059ad3190287f35
4
+ data.tar.gz: abd93b990583e6ab2c644b74647014767a43947d81fdf7f1b15abf198efad96c
5
5
  SHA512:
6
- metadata.gz: 3e0609f0dfd3a5d97ac09523110f558c99f0e2acc2e7d646ef2a974b107b65c4fd0001e44bb64079d1baaaa05dd5d52a8c3e853166cd08a384a7fe0ea0d29d47
7
- data.tar.gz: bee57f8a6d5ab1006d5bba159cec53e7cf86dbeeda98f73cc5a6d2c24a89b88c0362639c9b03eabade29316f615f67869114a665a95dfe851efcfca312203cbf
6
+ metadata.gz: 106e70eda991a01d9ce69a265958ea2dbe25fb27a0b316297b303ec97c5cffb6cb274b78a4ceb827d107f7644122947038c8cce696fcd8f8240cffb6cfe9e28f
7
+ data.tar.gz: 3b51d655011169c98ef738174c054733aaa4ebe737ebd53b0725f4f062e7b939bc4d72e3561a8c12d309240b68ded7d311ac91819da0b74d21f411240a249987
@@ -23,13 +23,13 @@ class Iro::Alert
23
23
  field :class_name, default: 'Iro::Stock'
24
24
  validates :class_name, presence: true
25
25
 
26
- field :symbol
26
+ field :symbol, type: String
27
27
  validates :symbol, presence: true
28
28
 
29
- field :direction
29
+ field :direction, type: String
30
30
  validates :direction, presence: true
31
31
 
32
- field :strike
32
+ field :strike, type: Float
33
33
  validates :strike, presence: true
34
34
 
35
35
  def do_run
@@ -37,13 +37,11 @@ class Iro::Alert
37
37
  begin
38
38
  price = Tda::Stock.get_quote( alert.symbol ).last
39
39
 
40
- if alert.direction == self.class::DIRECTION_ABOVE && price >= alert.strike ||
41
- alert.direction == self.class::DIRECTION_BELOW && price <= alert.strike
42
-
43
-
40
+ if ( alert.direction == alert.class::DIRECTION_ABOVE && price >= alert.strike ) ||
41
+ ( alert.direction == alert.class::DIRECTION_BELOW && price <= alert.strike )
44
42
 
45
43
  Iro::AlertMailer.stock_alert( alert.id.to_s ).deliver_later
46
- alert.update({ status: self.class::STATUS_INACTIVE })
44
+ alert.update({ status: alert.class::STATUS_INACTIVE })
47
45
  print '^'
48
46
 
49
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_warbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7.16
4
+ version: 2.0.7.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev