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.
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/a-core.rb', line 1254 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
1268 1269 1270 1271 1272 |
# File 'lib/a-core.rb', line 1268 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.
1249 1250 1251 |
# File 'lib/a-core.rb', line 1249 def action @action end |
#caption ⇒ Object
Returns the value of attribute caption.
1247 1248 1249 |
# File 'lib/a-core.rb', line 1247 def @caption end |
#context ⇒ Object
Returns the value of attribute context.
1245 1246 1247 |
# File 'lib/a-core.rb', line 1245 def context @context end |
#context_caption ⇒ Object
Returns the value of attribute context_caption.
1246 1247 1248 |
# File 'lib/a-core.rb', line 1246 def @context_caption end |
#event_args ⇒ Object
Returns the value of attribute event_args.
1251 1252 1253 |
# File 'lib/a-core.rb', line 1251 def event_args @event_args end |
#event_class ⇒ Object
Returns the value of attribute event_class.
1250 1251 1252 |
# File 'lib/a-core.rb', line 1250 def event_class @event_class end |
#hint ⇒ Object
Returns the value of attribute hint.
1248 1249 1250 |
# File 'lib/a-core.rb', line 1248 def hint @hint end |
#image_data ⇒ Object
Returns the value of attribute image_data.
1252 1253 1254 |
# File 'lib/a-core.rb', line 1252 def image_data @image_data end |
#item_obj ⇒ Object (readonly)
Returns the value of attribute item_obj.
1253 1254 1255 |
# File 'lib/a-core.rb', line 1253 def item_obj @item_obj end |
#name ⇒ Object
Returns the value of attribute name.
1243 1244 1245 |
# File 'lib/a-core.rb', line 1243 def name @name end |
#rif ⇒ Object
Returns the value of attribute rif.
1244 1245 1246 |
# File 'lib/a-core.rb', line 1244 def rif @rif end |
Instance Method Details
#background ⇒ Object
1278 1279 |
# File 'lib/a-core.rb', line 1278 def background end |
#enable=(_value) ⇒ Object
1275 1276 |
# File 'lib/a-core.rb', line 1275 def enable=(_value) end |
#foreground ⇒ Object
1281 1282 |
# File 'lib/a-core.rb', line 1281 def foreground end |