Class: OhMyLog::Log::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/oh_my_log/selector.rb

Overview

Selector is a set of rule that Log.loggable? will have to respect

Constant Summary collapse

METHODS =
["GET", "HEAD", "POST", "PATCH", "PUT", "DELETE"].freeze
ACTIONS =
["ONLY", "EXCEPT", "ALL"].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controllers: default_hash_setting, actions: default_hash_setting, ips: default_hash_setting, status_codes: default_hash_setting) ⇒ Selector

TODO: add methods in the same style as anything else and it will affect the parameter method in the loggable function in LOG.rb EXCEPT O ONLY



11
12
13
14
15
16
17
# File 'lib/oh_my_log/selector.rb', line 11

def initialize(controllers: default_hash_setting, actions: default_hash_setting, ips: default_hash_setting, status_codes: default_hash_setting)
  @controllers = controllers
  @actions = actions
  @ips = ips
  @status_codes = status_codes
  build_attr_setters
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



5
6
7
# File 'lib/oh_my_log/selector.rb', line 5

def actions
  @actions
end

#controllersObject (readonly)

Returns the value of attribute controllers.



5
6
7
# File 'lib/oh_my_log/selector.rb', line 5

def controllers
  @controllers
end

#ipsObject (readonly)

Returns the value of attribute ips.



5
6
7
# File 'lib/oh_my_log/selector.rb', line 5

def ips
  @ips
end

#status_codesObject (readonly)

Returns the value of attribute status_codes.



5
6
7
# File 'lib/oh_my_log/selector.rb', line 5

def status_codes
  @status_codes
end