Skip to content

hcliu/circular_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circular List
=============

A circular list data structure for Ruby.

How to install
--------------

gem install circular_list

OR

gem 'circular_list'  in Gemfile


How to use
----------

require 'rubygems'
require 'circular_list'

c = CircularList::List.new([1,2,3])
c.fetch_next   => 2
c.fetch_next   => 3
c.fetch_next   => 1
c.fetch_next   => 2

c = CircularList::List.new([1,2,3])
c.fetch_previous   => 3
c.fetch_previous   => 2
c.fetch_previous   => 1
c.fetch_previous   => 3

See specs https://github.com/bangthetable/CircularList/blob/master/spec/circular_list/list_spec.rb for more examples.

About

A cyclic data structure for Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages