Class: CBOR::Sequence
- Defined in:
- lib/cbor-pure.rb,
lib/cbor-diagnostic.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
Returns the value of attribute elements.
Instance Method Summary collapse
- #cbor_diagnostic(options = {}) ⇒ Object
- #to_cborseq ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Instance Attribute Details
#elements ⇒ Object
Returns the value of attribute elements
67 68 69 |
# File 'lib/cbor-pure.rb', line 67 def elements @elements end |
Instance Method Details
#cbor_diagnostic(options = {}) ⇒ Object
105 106 107 108 109 110 111 112 113 |
# File 'lib/cbor-diagnostic.rb', line 105 def cbor_diagnostic( = {}) if elements == [] "/ empty CBOR sequence /" else elements.map{ |el| el.cbor_diagnostic() }.join(", ") end end |
#to_cborseq ⇒ Object
72 73 74 |
# File 'lib/cbor-pure.rb', line 72 def to_cborseq CBOR.encode_seq(elements) end |
#to_s ⇒ Object Also known as: inspect
68 69 70 |
# File 'lib/cbor-pure.rb', line 68 def to_s elements.map(&:to_s).join(", ") end |