Module: EDNGRAMMAR::RAppStringB646
- Defined in:
- lib/parser/edngrammar.rb
Instance Method Summary collapse
Instance Method Details
#ast ⇒ Object
10933 10934 10935 10936 10937 10938 10939 10940 10941 10942 10943 10944 10945 |
# File 'lib/parser/edngrammar.rb', line 10933 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 |