Class: ArcadiaUserControl::UserItem
- Inherits:
-
Object
- Object
- ArcadiaUserControl::UserItem
- Defined in:
- lib/a-core.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#context ⇒ Object
Returns the value of attribute context.
-
#context_caption ⇒ Object
Returns the value of attribute context_caption.
-
#event_args ⇒ Object
Returns the value of attribute event_args.
-
#event_class ⇒ Object
Returns the value of attribute event_class.
-
#hint ⇒ Object
Returns the value of attribute hint.
-
#image_data ⇒ Object
Returns the value of attribute image_data.
-
#item_obj ⇒ Object
readonly
Returns the value of attribute item_obj.
-
#name ⇒ Object
Returns the value of attribute name.
-
#rif ⇒ Object
Returns the value of attribute rif.
Instance Method Summary collapse
- #background ⇒ Object
- #enable=(_value) ⇒ Object
- #foreground ⇒ Object
-
#initialize(_sender, _args) ⇒ UserItem
constructor
A new instance of UserItem.
- #method_missing(m, *args) ⇒ Object
Constructor Details
#initialize(_sender, _args) ⇒ UserItem
Returns a new instance of UserItem.
1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 |
# File 'lib/a-core.rb', line 1304 def initialize(_sender, _args) @sender = _sender if _args _args.each do |key, value| self.send(key+'=', value) if self.respond_to?(key) end end if @action @command = proc{Arcadia.process_event(_sender.instance_eval(@action))} elsif @event_class @command = proc{Arcadia.process_event(@event_class.new(_sender, @event_args))} end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
1318 1319 1320 1321 1322 |
# File 'lib/a-core.rb', line 1318 def method_missing(m, *args) if @item_obj && @item_obj.respond_to?(m) @item_obj.send(m, *args) end end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
1299 1300 1301 |
# File 'lib/a-core.rb', line 1299 def action @action end |
#caption ⇒ Object
Returns the value of attribute caption.
1297 1298 1299 |
# File 'lib/a-core.rb', line 1297 def @caption end |
#context ⇒ Object
Returns the value of attribute context.
1295 1296 1297 |
# File 'lib/a-core.rb', line 1295 def context @context end |
#context_caption ⇒ Object
Returns the value of attribute context_caption.
1296 1297 1298 |
# File 'lib/a-core.rb', line 1296 def @context_caption end |
#event_args ⇒ Object
Returns the value of attribute event_args.
1301 1302 1303 |
# File 'lib/a-core.rb', line 1301 def event_args @event_args end |
#event_class ⇒ Object
Returns the value of attribute event_class.
1300 1301 1302 |
# File 'lib/a-core.rb', line 1300 def event_class @event_class end |
#hint ⇒ Object
Returns the value of attribute hint.
1298 1299 1300 |
# File 'lib/a-core.rb', line 1298 def hint @hint end |
#image_data ⇒ Object
Returns the value of attribute image_data.
1302 1303 1304 |
# File 'lib/a-core.rb', line 1302 def image_data @image_data end |
#item_obj ⇒ Object (readonly)
Returns the value of attribute item_obj.
1303 1304 1305 |
# File 'lib/a-core.rb', line 1303 def item_obj @item_obj end |
#name ⇒ Object
Returns the value of attribute name.
1293 1294 1295 |
# File 'lib/a-core.rb', line 1293 def name @name end |
#rif ⇒ Object
Returns the value of attribute rif.
1294 1295 1296 |
# File 'lib/a-core.rb', line 1294 def rif @rif end |
Instance Method Details
#background ⇒ Object
1328 1329 |
# File 'lib/a-core.rb', line 1328 def background end |
#enable=(_value) ⇒ Object
1325 1326 |
# File 'lib/a-core.rb', line 1325 def enable=(_value) end |
#foreground ⇒ Object
1331 1332 |
# File 'lib/a-core.rb', line 1331 def foreground end |