Skip to content
Singleton module in mruby based on
Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
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

You can’t perform that action at this time.