module CMF
The top-level module for the cmf gem.
Constants
- VERSION
This gem's version.
Public Class Methods
build(obj, dictionary = nil)
click to toggle source
Builds a CMF
message from an object.
@param obj [Hash,#each] The object to be built into a CMF
message. Can be
a hash, or any object that responds to `.each` and yields (tag, value) pairs.
@param dictionary [Hash,Array] Optional. The dictionary mapping tag
names to numbers. See {Dictionary.validate}.
@return [String] An octet string, each character representing one byte of
the CMF message.
# File lib/cmf.rb, line 20 def self.build(obj, dictionary = nil) Builder.new(dictionary).build(obj).to_octet end
build_hex(obj, dictionary = nil)
click to toggle source
Builds hex-encoded a CMF
message from an object.
@see #CMF.build @return [String] A hex string, every 2 characters representing one byte of
the CMF message.
# File lib/cmf.rb, line 29 def self.build_hex(obj, dictionary = nil) Builder.new(dictionary).build(obj).to_hex end
parse(message, dictionary = nil)
click to toggle source
parse_hex(message_hex, dictionary = nil)
click to toggle source