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.



1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
# File 'lib/a-core.rb', line 1480

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



1494
1495
1496
1497
1498
# File 'lib/a-core.rb', line 1494

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.



1475
1476
1477
# File 'lib/a-core.rb', line 1475

def action
  @action
end

#captionObject

Returns the value of attribute caption.



1473
1474
1475
# File 'lib/a-core.rb', line 1473

def caption
  @caption
end

#contextObject

Returns the value of attribute context.



1471
1472
1473
# File 'lib/a-core.rb', line 1471

def context
  @context
end

#context_captionObject

Returns the value of attribute context_caption.



1472
1473
1474
# File 'lib/a-core.rb', line 1472

def context_caption
  @context_caption
end

#event_argsObject

Returns the value of attribute event_args.



1477
1478
1479
# File 'lib/a-core.rb', line 1477

def event_args
  @event_args
end

#event_classObject

Returns the value of attribute event_class.



1476
1477
1478
# File 'lib/a-core.rb', line 1476

def event_class
  @event_class
end

#hintObject

Returns the value of attribute hint.



1474
1475
1476
# File 'lib/a-core.rb', line 1474

def hint
  @hint
end

#image_dataObject

Returns the value of attribute image_data.



1478
1479
1480
# File 'lib/a-core.rb', line 1478

def image_data
  @image_data
end

#item_objObject (readonly)

Returns the value of attribute item_obj.



1479
1480
1481
# File 'lib/a-core.rb', line 1479

def item_obj
  @item_obj
end

#nameObject

Returns the value of attribute name.



1469
1470
1471
# File 'lib/a-core.rb', line 1469

def name
  @name
end

#rifObject

Returns the value of attribute rif.



1470
1471
1472
# File 'lib/a-core.rb', line 1470

def rif
  @rif
end

Instance Method Details

#backgroundObject



1504
1505
# File 'lib/a-core.rb', line 1504

def background
end

#enable=(_value) ⇒ Object



1501
1502
# File 'lib/a-core.rb', line 1501

def enable=(_value)
end

#foregroundObject



1507
1508
# File 'lib/a-core.rb', line 1507

def foreground
end