Skip to content

Commit 9a0085f

Browse files
committed
Add types in methods definitions
1 parent 5c478ce commit 9a0085f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/ucl.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ require "./ucl/*"
33
module UCL
44
VERSION = "0.1.0"
55

6-
def self.load(string)
6+
def self.load(string : String) : UCL::Value::Type
77
Decoder.decode(string)
88
end
99

10-
def self.dump(object, emit_type = Encoder::DEFAULT_EMITTER)
10+
def self.dump(object, emit_type = Encoder::DEFAULT_EMITTER) : String
1111
Encoder.encode(object, emit_type)
1212
end
1313
end

src/ucl/decoder.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module UCL
22
class Decoder
3-
def self.decode(string)
3+
def self.decode(string : String) : UCL::Value::Type
44
object = UCL::Parser.parse(string)
55
from_ucl_object(object)
66
end

src/ucl/encoder.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module UCL
1111

1212
DEFAULT_EMITTER = "config"
1313

14-
def self.encode(object, emit_type = DEFAULT_EMITTER)
14+
def self.encode(object, emit_type = DEFAULT_EMITTER) : String
1515
emitter = EMITTERS[emit_type]?
1616
raise UCL::Error::EncoderError.new("Unknown emitter format: #{emit_type}") if emitter.nil?
1717

src/ucl/parser.cr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module UCL
22
class Parser
3-
def self.parse(string)
3+
def self.parse(string : String)
44
parser = new
55
parser.parse(string)
66
end
@@ -13,7 +13,7 @@ module UCL
1313
@parser = UCL::LibUCL.new(flags)
1414
end
1515

16-
def parse(string)
16+
def parse(string : String)
1717
load_string(string)
1818
check_error
1919
load_result

0 commit comments

Comments
 (0)