0.0
No release in over a year
VedDecoder is a decoder for the Google ved parameter
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

VedDecoder

VedDecoder is a decoder for the Google ved parameter.

Links to ved's explanations:

Installation

Add this line to your application's Gemfile:

gem 'ved_decoder'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install ved_decoder

Usage

# Decode ved starts with '1'
v = VedDecoder.decode('1t:22,r:6,i:86,s:90')
# => <VedDecoder::Ved: index: 86, type: 22, result_position: 6, start_page: 90>

# Decode ved starts with '0' or '2'
v = VedDecoder.decode('2ahUKEwjZ5rDNt67pAhVDLKwKHS4wDD4QzLECKAEwSnoECBYQCg')
# => <VedDecoder::Ved: type: 39116, sub_result_position: 1, result_position: 74>

# Get values
v.to_h
# => {:type=>39116, :sub_result_position=>1, :result_position=>74}
v.type
# => 39116
v.result_position
# => 74

License

The gem is available as open source under the terms of the MIT License.