Module: UIC::ElementBacked::ClassMethods
- Included in:
- Application::Behavior, Application::Effect, Application::Presentation, Application::RenderPlugin, Application::StateMachine
- Defined in:
- lib/ruic/interfaces.rb
Instance Method Summary collapse
-
#xmlattribute(name, getblock = nil, &setblock) ⇒ Object
Add methods to instances of the class which gets/sets from an XML attribute.
Instance Method Details
#xmlattribute(name, getblock = nil, &setblock) ⇒ Object
Add methods to instances of the class which gets/sets from an XML attribute.
107 108 109 110 |
# File 'lib/ruic/interfaces.rb', line 107 def xmlattribute(name,getblock=nil,&setblock) define_method(name){ getblock ? getblock[@el[name],self] : @el[name] } define_method("#{name}="){ |new_value| @el[name] = (setblock ? setblock[new_value,self] : new_value).to_s } end |