Singleton module in mruby based on
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mrblib
test
LICENSE.txt
README.md
mrbgem.rake

README.md

mruby-singleton

Singleton module in mruby.

class Example
  include Singleton
  attr_accessor :keep
end

a = Example.instance
b = Example.instance
a.keep = "keep this"
p b.keep #=> "keep this"
a.keep = nil
p b.keep #=> nil

Installation

use github repository

Write in /mruby/build_config.rb

MRuby::Build.new do |conf|
  conf.gem :github => 'ksss/mruby-singleton', :branch => 'master'
end

or use mgem

mgem add mruby-singleton

build

and exec in your /mruby.

rake clean
rake
rake test

License

MIT