Class: ArcadiaUserControl::UserItem

Inherits:
Object
  • Object
show all
Defined in:
lib/a-core.rb

Direct Known Subclasses

ArcadiaMainToolbar::UserItem

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_sender, _args) ⇒ UserItem

Returns a new instance of UserItem.



1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
# File 'lib/a-core.rb', line 1386

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



1400
1401
1402
1403
1404
# File 'lib/a-core.rb', line 1400

def method_missing(m, *args)
  if @item_obj && @item_obj.respond_to?(m)
    @item_obj.send(m, *args)
  end
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



1381
1382
1383
# File 'lib/a-core.rb', line 1381

def action
  @action
end

#captionObject

Returns the value of attribute caption.



1379
1380
1381
# File 'lib/a-core.rb', line 1379

def caption
  @caption
end

#contextObject

Returns the value of attribute context.



1377
1378
1379
# File 'lib/a-core.rb', line 1377

def context
  @context
end

#context_captionObject

Returns the value of attribute context_caption.



1378
1379
1380
# File 'lib/a-core.rb', line 1378

def context_caption
  @context_caption
end

#event_argsObject

Returns the value of attribute event_args.



1383
1384
1385
# File 'lib/a-core.rb', line 1383

def event_args
  @event_args
end

#event_classObject

Returns the value of attribute event_class.



1382
1383
1384
# File 'lib/a-core.rb', line 1382

def event_class
  @event_class
end

#hintObject

Returns the value of attribute hint.



1380
1381
1382
# File 'lib/a-core.rb', line 1380

def hint
  @hint
end

#image_dataObject

Returns the value of attribute image_data.



1384
1385
1386
# File 'lib/a-core.rb', line 1384

def image_data
  @image_data
end

#item_objObject (readonly)

Returns the value of attribute item_obj.



1385
1386
1387
# File 'lib/a-core.rb', line 1385

def item_obj
  @item_obj
end

#nameObject

Returns the value of attribute name.



1375
1376
1377
# File 'lib/a-core.rb', line 1375

def name
  @name
end

#rifObject

Returns the value of attribute rif.



1376
1377
1378
# File 'lib/a-core.rb', line 1376

def rif
  @rif
end

Instance Method Details

#backgroundObject



1410
1411
# File 'lib/a-core.rb', line 1410

def background
end

#enable=(_value) ⇒ Object



1407
1408
# File 'lib/a-core.rb', line 1407

def enable=(_value)
end

#foregroundObject



1413
1414
# File 'lib/a-core.rb', line 1413

def foreground
end