Module: EDNGRAMMAR::AppStringB646
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 |
# File 'lib/parser/edngrammar.rb', line 8610 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 |