README.md in alephant-sequencer-0.0.7 vs README.md in alephant-sequencer-0.0.8

- old
+ new

@@ -22,32 +22,37 @@ $ gem install alephant-sequencer ## Usage ```rb +require "alephant/sequencer" -require 'alephant-sequencer' +# Ensure you check your AWS region configuration before you start using `AWS.config.region` +# To set the value use: AWS.config(region: 'eu-west-1') -#Optional JSONPath specifying location of sequence_id -sequence_id = '$.sequence_number' +table_name = "foo" +component_id = "bar_baz/e8c81cbbbeb3967a423bb49e352eed0e" +sequence_id = "$.sequence_number" # Optional JSONPath (specifying location of sequence_id) -sequencer = Sequencer.create(table_name, sqs_queue_url, sequence_id) +sequencer = Alephant::Sequencer.create(table_name, component_id, sequence_id) # Data from SQS message -data = Struct.new(:body).new({:sequence_number => 3}) +json = JSON.generate({ :sequence_number => 3 }) +msg = Struct.new(:body).new(json) # Sets last seen id -sequencer.set_last_seen(data) +sequencer.set_last_seen(msg) # Gets last seen id sequencer.get_last_seen # => 3 # Is the message sequential? -sequencer.sequential?(data) +sequencer.sequential?(msg) # Reset sequence sequencer.delete! +``` ## Contributing 1. Fork it ( http://github.com/<my-github-username>/alephant-sequencer/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`)