Class: Lokal::Options

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



222
223
224
225
226
227
228
229
230
231
# File 'lib/lokal.rb', line 222

def initialize
  @basic_auth = []
  @cidr_allow = []
  @cidr_deny = []
  @request_header_add = []
  @request_header_remove = []
  @response_header_add = []
  @response_header_remove = []
  @header_key = []
end

Instance Attribute Details

#basic_authObject

Returns the value of attribute basic_auth.



219
220
221
# File 'lib/lokal.rb', line 219

def basic_auth
  @basic_auth
end

#cidr_allowObject

Returns the value of attribute cidr_allow.



219
220
221
# File 'lib/lokal.rb', line 219

def cidr_allow
  @cidr_allow
end

#cidr_denyObject

Returns the value of attribute cidr_deny.



219
220
221
# File 'lib/lokal.rb', line 219

def cidr_deny
  @cidr_deny
end

#header_keyObject

Returns the value of attribute header_key.



219
220
221
# File 'lib/lokal.rb', line 219

def header_key
  @header_key
end

#request_header_addObject

Returns the value of attribute request_header_add.



219
220
221
# File 'lib/lokal.rb', line 219

def request_header_add
  @request_header_add
end

#request_header_removeObject

Returns the value of attribute request_header_remove.



219
220
221
# File 'lib/lokal.rb', line 219

def request_header_remove
  @request_header_remove
end

#response_header_addObject

Returns the value of attribute response_header_add.



219
220
221
# File 'lib/lokal.rb', line 219

def response_header_add
  @response_header_add
end

#response_header_removeObject

Returns the value of attribute response_header_remove.



219
220
221
# File 'lib/lokal.rb', line 219

def response_header_remove
  @response_header_remove
end

Instance Method Details

#to_hObject



233
234
235
236
237
# File 'lib/lokal.rb', line 233

def to_h
  instance_variables.each_with_object({}) do |var, hash|
    hash[var.to_s.delete('@')] = instance_variable_get(var)
  end
end