Sha256: 79942507d0b1cbb6027b5e53cb36bb293655e77efe6ebfb0e944b129c733cdf3

Contents?: true

Size: 479 Bytes

Versions: 15

Compression:

Stored size: 479 Bytes

Contents

require 'arrayfields'
#
# the struct class factory method can be used in much the same way as ruby's
# own struct generators and is useful when the fields for a set of arrays is
# known apriori
#
  c = Array.struct :a, :b, :c  # class generator 
  a = c.new [42, nil, nil]
  a[:c] = 42
  p a                          #=> [42, nil, 42]
#
# of course we can append too
#
  a[:d] = 42.0
  p a[:d]                      #=> 42.0
  p a                          #=> [42, nil, 42, 42.0]

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/arrayfields-4.7.4/sample/b.rb
arrayfields-4.9.2 sample/b.rb
arrayfields-4.9.0 sample/b.rb
arrayfields-4.7.0 sample/b.rb
arrayfields-4.7.3 sample/b.rb
arrayfields-4.1.0 sample/b.rb
arrayfields-4.2.0 sample/b.rb
arrayfields-4.4.0 sample/b.rb
arrayfields-4.0.0 sample/b.rb
arrayfields-4.5.0 sample/b.rb
arrayfields-4.6.0 sample/b.rb
arrayfields-4.7.2 sample/b.rb
arrayfields-4.7.1 sample/b.rb
arrayfields-4.3.0 sample/b.rb
arrayfields-4.7.4 sample/b.rb