# shared.rb works equally well with individual objects in addition to the
# normal class level usage
#

  require 'shared'

  shared(:meta_tools) do
    def singleton_class &block
      singleton_class =
        class << self
          self
        end
      block ? singleton_class.module_eval(&block) : singleton_class
    end
  end

  a = %w( a b c )

  a.extend shared(:meta_tools)

  a.singleton_class do
    def to_range() first .. last end
  end

  p a.to_range #=> "a".."c"
