Class: Module

Inherits:
Object show all
Includes:
Attributes
Defined in:
lib/alib-0.5.0/stdext.rb,
lib/alib-0.5.0/attributes.rb,
lib/alib-0.5.0/attributes-3.2.0.rb

Constant Summary

Constants included from Attributes

Attributes::VERSION

Instance Method Summary collapse

Methods included from Attributes

#attribute, #attributes, #version

Instance Method Details

#tattrs(*list) ⇒ Object Also known as: tattr



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/alib-0.5.0/stdext.rb', line 113

def tattrs *list 
#--{{{
  list.flatten.compact.map do |t|
    module_eval "      def \#{ t } *a\n        return(send('\#{ t }', a.shift)) unless a.empty?\n        Thread.current['\#{ t }']\n      end\n      def \#{ t }= val \n        Thread.current['\#{ t }?'] = true \n        Thread.current['\#{ t }'] = val\n      end\n      def \#{ t }?\n        Thread.current['\#{ t }?']\n      end\n    code\n    t.to_s\n  end\n#--}}}\nend\n"