Module: EDNGRAMMAR::SAppStringB646
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 |
# File 'lib/parser/edngrammar.rb', line 9432 def ast t = text_value.gsub(/\s|#[^\n]*(?:\n|\z)/, '').chars.each_slice(4).map(&:join) if last = t[-1] last << "=" * (4 - last.size) end b = t.join.tr("-_", "+/") begin b.unpack("m0")[0] rescue ArgumentError raise ArgumentError, "cbor-diagnostic: invalid base64 #{b.inspect}", caller[1..-1] end end |