Module: Ciri::RLP::Encode

Defined in:
lib/ciri/rlp/encode.rb

Defined Under Namespace

Classes: InputOverflow

Class Method Summary collapse

Class Method Details

.encode(input) ⇒ Object


33
34
35
36
37
38
39
40
41
42
# File 'lib/ciri/rlp/encode.rb', line 33

def encode(input)
  result = if input.is_a?(String)
             encode_string(input)
           elsif input.is_a?(Array)
             encode_list(input)
           else
             raise ArgumentError.new('input must be a String or Array')
           end
  result.b
end