syslog_client 0.1 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/syslog_client/deal_flow.rb +3 -2
- data/lib/syslog_client/editor.rb +1 -0
- data/lib/syslog_client/match_shop.rb +2 -1
- data/lib/syslog_client/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -5,16 +5,17 @@ module SyslogClient
|
|
5
5
|
protected
|
6
6
|
def log_of_options(options)
|
7
7
|
_normalize_options(options)
|
8
|
-
options.
|
8
|
+
options.reverse_merge(:operator => get_operator(options[:operation])).merge(:type => 'deal_flow')
|
9
9
|
end
|
10
10
|
|
11
11
|
def _normalize_options(options)
|
12
12
|
raise ArgumentError, 'options should be instance of Hash' unless options.is_a?(::Hash)
|
13
13
|
options.symbolize_keys!
|
14
|
+
options.assert_valid_keys(:deal_id, :operation, :operation_time, :operator, :result, :message )
|
14
15
|
end
|
15
16
|
|
16
17
|
def get_operator(operation)
|
17
|
-
operations.map do |k, v|
|
18
|
+
operation && operations.map do |k, v|
|
18
19
|
return k.to_s if v.include?(operation.to_sym)
|
19
20
|
end
|
20
21
|
end
|
data/lib/syslog_client/editor.rb
CHANGED
@@ -11,6 +11,7 @@ module SyslogClient
|
|
11
11
|
def _normalize_options(options)
|
12
12
|
raise ArgumentError, 'options should be instance of Hash' unless options.is_a?(::Hash)
|
13
13
|
options.symbolize_keys!
|
14
|
+
options.assert_valid_keys(:user_id, :reason, :entry_class, :entry_id, :operation_time, :changes, :object)
|
14
15
|
|
15
16
|
if options[:changes]
|
16
17
|
_normalize_changes(options)
|
@@ -5,12 +5,13 @@ module SyslogClient
|
|
5
5
|
protected
|
6
6
|
def log_of_options(options)
|
7
7
|
_normalize_options(options)
|
8
|
-
options.
|
8
|
+
options.merge(:type => 'match_shop')
|
9
9
|
end
|
10
10
|
|
11
11
|
def _normalize_options(options)
|
12
12
|
raise ArgumentError, 'options should be instance of Hash' unless options.is_a?(::Hash)
|
13
13
|
options.symbolize_keys!
|
14
|
+
options.assert_valid_keys(:reason, :source, :deal_id, :tuan_shop_id, :shop_info_id, :operation_time)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|