Class: ArcadiaUserControl::UserItem
- Inherits:
-
Object
- Object
- ArcadiaUserControl::UserItem
- Defined in:
- lib/a-core.rb
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.
1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 |
# File 'lib/a-core.rb', line 1007 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
1021 1022 1023 1024 1025 |
# File 'lib/a-core.rb', line 1021 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.
1002 1003 1004 |
# File 'lib/a-core.rb', line 1002 def action @action end |
#caption ⇒ Object
Returns the value of attribute caption.
1000 1001 1002 |
# File 'lib/a-core.rb', line 1000 def @caption end |
#context ⇒ Object
Returns the value of attribute context.
998 999 1000 |
# File 'lib/a-core.rb', line 998 def context @context end |
#context_caption ⇒ Object
Returns the value of attribute context_caption.
999 1000 1001 |
# File 'lib/a-core.rb', line 999 def @context_caption end |
#event_args ⇒ Object
Returns the value of attribute event_args.
1004 1005 1006 |
# File 'lib/a-core.rb', line 1004 def event_args @event_args end |
#event_class ⇒ Object
Returns the value of attribute event_class.
1003 1004 1005 |
# File 'lib/a-core.rb', line 1003 def event_class @event_class end |
#hint ⇒ Object
Returns the value of attribute hint.
1001 1002 1003 |
# File 'lib/a-core.rb', line 1001 def hint @hint end |
#image_data ⇒ Object
Returns the value of attribute image_data.
1005 1006 1007 |
# File 'lib/a-core.rb', line 1005 def image_data @image_data end |
#item_obj ⇒ Object (readonly)
Returns the value of attribute item_obj.
1006 1007 1008 |
# File 'lib/a-core.rb', line 1006 def item_obj @item_obj end |
#name ⇒ Object
Returns the value of attribute name.
996 997 998 |
# File 'lib/a-core.rb', line 996 def name @name end |
#rif ⇒ Object
Returns the value of attribute rif.
997 998 999 |
# File 'lib/a-core.rb', line 997 def rif @rif end |
Instance Method Details
#background ⇒ Object
1031 1032 |
# File 'lib/a-core.rb', line 1031 def background end |
#enable=(_value) ⇒ Object
1028 1029 |
# File 'lib/a-core.rb', line 1028 def enable=(_value) end |
#foreground ⇒ Object
1034 1035 |
# File 'lib/a-core.rb', line 1034 def foreground end |