Module: KotlinTemplateHelper

Defined in:
lib/arkana/helpers/kotlin_template_helper.rb

Overview

Utilities to reduce the amount of boilerplate code in ‘.kt.erb` template files.

Class Method Summary collapse

Class Method Details

.kotlin_decode_function(type) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/arkana/helpers/kotlin_template_helper.rb', line 14

def self.kotlin_decode_function(type)
  case type
    when :string then "decode"
    when :boolean then "decodeBoolean"
    when :integer then "decodeInt"
    else raise "Unknown variable type '#{type}' received."
  end
end

.kotlin_type(type) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/arkana/helpers/kotlin_template_helper.rb', line 5

def self.kotlin_type(type)
  case type
    when :string then "String"
    when :boolean then "Boolean"
    when :integer then "Int"
    else raise "Unknown variable type '#{type}' received."
  end
end