Module: EDNGRAMMAR::RAppStringB646
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
11297 11298 11299 11300 11301 11302 11303 11304 11305 11306 11307 11308 11309 |
# File 'lib/parser/edngrammar.rb', line 11297 def ast v = elements[0..2].map {|part| part.text_value}.join t = v.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 |