Method: StructWithType#initialize
- Defined in:
- lib/langhelp/langhelp-sub.rb
#initialize(*args) ⇒ StructWithType
Returns a new instance of StructWithType.
662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/langhelp/langhelp-sub.rb', line 662 def initialize(*args) args.each_with_index do |x, i| args[i] = __convert__(@@__keys__[i], x) end class << self @@__keys__.each do |k| define_method("#{k}="){|v| self[k]=v} end end super *args end |