Skip to content

Instantly share code, notes, and snippets.

@walf443
Created August 21, 2008 11:34
Show Gist options
  • Save walf443/6541 to your computer and use it in GitHub Desktop.
Save walf443/6541 to your computer and use it in GitHub Desktop.
# with ClassX::Declare
# cool!! thanks Naoto Takai
require 'classx'
#=> true
require 'classx/declare'
#=> true
include ClassX::Declare
#=> Object
classx "Hoge" do
has :x
end
#=> Hoge
Hoge.new(:x => 0)
#=> #<Hoge:0x111a7dc @__attribute_of={"x"=><#ClassX::Attribute {}:8966980 @data=0 >}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment