Module: DeviceAtlas::StringType

Included in:
String
Defined in:
lib/deviceatlas.rb

Constant Summary collapse

TRUE_VALUES =

Possible true values represented as String.

%w[t true on y yes 1].freeze
FALSE_VALUES =

Possible false values represented as String.

%w[f false off n no 0].freeze

Instance Method Summary collapse

Instance Method Details

#compare_values(others, operator) ⇒ Boolean

Compare string values.

Parameters:

  • operator (Symbol)

Returns:

  • (Boolean)

#to_boolBoolean

Convert a String value to boolean.

Returns:

  • (Boolean)

Raises:

  • (ArgumentError)

    if the value cannot be converted as boolean