gfresh_point 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66e3158bc268a3c817d77f98d55cb236d420d9e54ef09282b4f93c85a493649e
4
- data.tar.gz: ea87c05ac1a5728291dc9173820f9ce3f85e015031cc70b863a7167094bae080
3
+ metadata.gz: 1e9ae01ee7ae836a03b5969021c96d56d9e0c19c5e83bf641ee7d0b672da2bab
4
+ data.tar.gz: '093239eb7dba0740af51a358317660cbc3361577bdd5f7fc70491ee6f07c5fe8'
5
5
  SHA512:
6
- metadata.gz: 0c649b18fcf0f07f1ac4f6c1ecf113a1a8b34d2f178c3da2f0480a659ccb707111424a1c9eb6880d82d7631964844f6b46cb955006fa8b61cccc3c1259637ba5
7
- data.tar.gz: 190c8f762be2b613ed28cff1db07aac1156258f9194559ef5779b9ac883f4447dbf56b72415d26dd89c0ff7164b5fa38acfa0563539247722c0d59a0c4405388
6
+ metadata.gz: 17333422d8c98de6dd258a95af67c0fb8b1cd20c17717c51fee754cda6ee72078e6ffcd39bfed7a889d6e03ff44d81c248e00aa707a2f85ed5e9187d888ea5b7
7
+ data.tar.gz: 25d67d98a0a5c17412fbc5e28a2c210e4eacf4cb53b6da4bcc16b2fa08d120d6cd3b96757eea9e2ca0fd6958a9da69d59d9f95ab01d270c8364f35d1d4a2c907
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gfresh_point (0.1.1)
4
+ gfresh_point (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -4,6 +4,7 @@ class CreateGfreshPointRule < ActiveRecord::Migration[5.2]
4
4
  t.string :app_id
5
5
  t.string :event_name
6
6
  t.integer :point
7
+ t.string :name
7
8
 
8
9
  t.timestamps
9
10
  end
@@ -1,11 +1,11 @@
1
1
  module GfreshPoint
2
2
  module Domain
3
3
  class Rule
4
+ attr_accessor :app_id, :event_name, :point, :name
4
5
 
5
- attr_accessor :app_id, :event_name, :point
6
-
7
- def initialize(app_id:, event_name:, point:)
6
+ def initialize(app_id:, event_name:, point:, name: nil)
8
7
  @app_id = app_id
8
+ @name = name
9
9
  @event_name = event_name
10
10
  @point = point
11
11
  end
@@ -8,8 +8,8 @@ module GfreshPoint
8
8
  Rule.where(app_id: app_id)
9
9
  end
10
10
 
11
- def update_rule_point(app_id, rule_id, point)
12
- Rule.find(rule_id).update!(point: point)
11
+ def update_rule_point(app_id, rule_id, point, name)
12
+ Rule.find(rule_id).update!(point: point, name: name)
13
13
  end
14
14
 
15
15
  def get_user_last_balance(app_id, user_id)
@@ -1,11 +1,12 @@
1
1
  module GfreshPoint
2
2
  module RequestObjects
3
3
  class UpdateRulePointRequest < RequestObject
4
- attr_accessor :app_id, :rule_id, :point
4
+ attr_accessor :app_id, :rule_id, :point, :name
5
5
 
6
- def initialize(app_id, rule_id, point)
6
+ def initialize(app_id, rule_id, point, name)
7
7
  @app_id = app_id
8
8
  @rule_id = rule_id
9
+ @name = name
9
10
  @point = point
10
11
 
11
12
  if app_id.blank?
@@ -2,7 +2,7 @@ module GfreshPoint
2
2
  module Usecase
3
3
  class UpdateRulePointUsecase < BaseUsecase
4
4
  def execute(request)
5
- rules = repo.update_rule_point(request.app_id, request.rule_id, request.point)
5
+ rules = repo.update_rule_point(request.app_id, request.rule_id, request.point, request.name)
6
6
  end
7
7
  end
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module GfreshPoint
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/gfresh_point.rb CHANGED
@@ -40,8 +40,8 @@ module GfreshPoint
40
40
  response
41
41
  end
42
42
 
43
- def update_rule_point(rule_id, point)
44
- request = GfreshPoint::RequestObjects::UpdateRulePointRequest.new(app_id, rule_id, point)
43
+ def update_rule_point(rule_id, point, name = nil)
44
+ request = GfreshPoint::RequestObjects::UpdateRulePointRequest.new(app_id, rule_id, point, name)
45
45
  use_case = GfreshPoint::Usecase::UpdateRulePointUsecase.new(repo)
46
46
  response = use_case.call(request)
47
47
  response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gfresh_point
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - teddy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2019-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler