Sha256: 1c663cf057ec9ef933a9a8f1b9c1ae06770e86fb0ac3d9a2741754cdfe7ef16b
Contents?: true
Size: 407 Bytes
Versions: 5
Compression:
Stored size: 407 Bytes
Contents
# # basic usage is like attr, but note that attribute defines three methods, # getter, setter, and query # require 'attributes' class C attribute 'a' end c = C.new c.a = 42 # setter p c.a # getter p 'forty-two' if c.a? # query # # also not that attribute(s) works as well for objects as classes # o = Object.new o.attribute 'answer' => 42 p o.answer
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
attributes-3.6.0 | samples/a.rb |
attributes-3.2.0 | samples/a.rb |
attributes-3.5.0 | samples/a.rb |
attributes-3.7.0 | samples/a.rb |
attributes-3.3.0 | samples/a.rb |