syslog_client 0.1 → 0.1.1

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.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
1
  syslog_client
2
2
  =============
3
3
 
4
- syslog_client with tuan800
4
+ syslog_client with tuan800
@@ -5,16 +5,17 @@ module SyslogClient
5
5
  protected
6
6
  def log_of_options(options)
7
7
  _normalize_options(options)
8
- options.slice(:deal_id, :operation, :operation_time, :operator, :result, :message).reverse_merge(:operator => get_operator(options[:operation])).merge(:type => 'deal_flow')
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
@@ -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.slice(:reason, :source, :deal_id, :tuan_shop_id, :shop_info_id, :operation_time).merge(:type => 'match_shop')
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
@@ -1,3 +1,3 @@
1
1
  module SyslogClient
2
- Version = VERSION = '0.1'
2
+ Version = VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syslog_client
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: