Class: Rox::Server::NormalizeFlagType

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/server/flags/normalize_flag_type.rb

Class Method Summary collapse

Class Method Details

.normalize_boolean(string_value) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/rox/server/flags/normalize_flag_type.rb', line 16

def self.normalize_boolean(string_value)
  if string_value.is_a?(Boolean)
    string_value
  else
    string_value == 'True'
  end
end

.normalize_float(string_value) ⇒ Object



12
13
14
# File 'lib/rox/server/flags/normalize_flag_type.rb', line 12

def self.normalize_float(string_value)
  Float(string_value)
end

.normalize_int(string_value) ⇒ Object



8
9
10
# File 'lib/rox/server/flags/normalize_flag_type.rb', line 8

def self.normalize_int(string_value)
  Integer(string_value)
end

.normalize_string(string_value) ⇒ Object



4
5
6
# File 'lib/rox/server/flags/normalize_flag_type.rb', line 4

def self.normalize_string(string_value)
  string_value
end