Module: Type

Defined in:
lib/arkana/models/type.rb

Overview

A namespace that defines language-agnostic variable types.

Constant Summary collapse

STRING =
:string
BOOLEAN =
:boolean
INTEGER =
:integer

Class Method Summary collapse

Class Method Details

.new(string_value:) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/arkana/models/type.rb', line 9

def self.new(string_value:)
  case string_value
  when "true", "false"
    BOOLEAN
  when /^\d+$/
    INTEGER
  else
    STRING
  end
end