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.



1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
# File 'lib/a-core.rb', line 1279

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



1293
1294
1295
1296
1297
# File 'lib/a-core.rb', line 1293

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.



1274
1275
1276
# File 'lib/a-core.rb', line 1274

def action
  @action
end

#captionObject

Returns the value of attribute caption.



1272
1273
1274
# File 'lib/a-core.rb', line 1272

def caption
  @caption
end

#contextObject

Returns the value of attribute context.



1270
1271
1272
# File 'lib/a-core.rb', line 1270

def context
  @context
end

#context_captionObject

Returns the value of attribute context_caption.



1271
1272
1273
# File 'lib/a-core.rb', line 1271

def context_caption
  @context_caption
end

#event_argsObject

Returns the value of attribute event_args.



1276
1277
1278
# File 'lib/a-core.rb', line 1276

def event_args
  @event_args
end

#event_classObject

Returns the value of attribute event_class.



1275
1276
1277
# File 'lib/a-core.rb', line 1275

def event_class
  @event_class
end

#hintObject

Returns the value of attribute hint.



1273
1274
1275
# File 'lib/a-core.rb', line 1273

def hint
  @hint
end

#image_dataObject

Returns the value of attribute image_data.



1277
1278
1279
# File 'lib/a-core.rb', line 1277

def image_data
  @image_data
end

#item_objObject (readonly)

Returns the value of attribute item_obj.



1278
1279
1280
# File 'lib/a-core.rb', line 1278

def item_obj
  @item_obj
end

#nameObject

Returns the value of attribute name.



1268
1269
1270
# File 'lib/a-core.rb', line 1268

def name
  @name
end

#rifObject

Returns the value of attribute rif.



1269
1270
1271
# File 'lib/a-core.rb', line 1269

def rif
  @rif
end

Instance Method Details

#backgroundObject



1303
1304
# File 'lib/a-core.rb', line 1303

def background
end

#enable=(_value) ⇒ Object



1300
1301
# File 'lib/a-core.rb', line 1300

def enable=(_value)
end

#foregroundObject



1306
1307
# File 'lib/a-core.rb', line 1306

def foreground
end