class Beowulf::Type::ExtensionJson
Public Class Methods
new(options = {})
click to toggle source
# File lib/beowulf/type/extension_json.rb, line 8 def initialize(options = {}) @data = options[:data] || "" end
Public Instance Methods
to_bytes()
click to toggle source
# File lib/beowulf/type/extension_json.rb, line 12 def to_bytes pakStr(@data) end
to_json(options)
click to toggle source
# File lib/beowulf/type/extension_json.rb, line 20 def to_json(options) JSON.dump ({ :data => @data }) end
to_s()
click to toggle source
# File lib/beowulf/type/extension_json.rb, line 16 def to_s {"data" => @data} end