Class: Streamingly::KV

Inherits:
Struct
  • Object
show all
Defined in:
lib/streamingly/kv.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



3
4
5
# File 'lib/streamingly/kv.rb', line 3

def key
  @key
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/streamingly/kv.rb', line 3

def value
  @value
end

Instance Method Details

#split(char = "\t", limit = 1) ⇒ Object



14
15
16
# File 'lib/streamingly/kv.rb', line 14

def split(char="\t", limit=1)
  [key, value]
end

#stripObject



9
10
11
# File 'lib/streamingly/kv.rb', line 9

def strip
  self
end

#to_sObject



4
5
6
# File 'lib/streamingly/kv.rb', line 4

def to_s
  [ SerDe.to_csv(key), SerDe.to_csv(value) ].join("\t")
end