Class: ArcadiaUserControl::UserItem

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_sender, _args) ⇒ UserItem

Returns a new instance of UserItem.



1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/a-core.rb', line 1020

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



1034
1035
1036
1037
1038
# File 'lib/a-core.rb', line 1034

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.



1015
1016
1017
# File 'lib/a-core.rb', line 1015

def action
  @action
end

#captionObject

Returns the value of attribute caption.



1013
1014
1015
# File 'lib/a-core.rb', line 1013

def caption
  @caption
end

#contextObject

Returns the value of attribute context.



1011
1012
1013
# File 'lib/a-core.rb', line 1011

def context
  @context
end

#context_captionObject

Returns the value of attribute context_caption.



1012
1013
1014
# File 'lib/a-core.rb', line 1012

def context_caption
  @context_caption
end

#event_argsObject

Returns the value of attribute event_args.



1017
1018
1019
# File 'lib/a-core.rb', line 1017

def event_args
  @event_args
end

#event_classObject

Returns the value of attribute event_class.



1016
1017
1018
# File 'lib/a-core.rb', line 1016

def event_class
  @event_class
end

#hintObject

Returns the value of attribute hint.



1014
1015
1016
# File 'lib/a-core.rb', line 1014

def hint
  @hint
end

#image_dataObject

Returns the value of attribute image_data.



1018
1019
1020
# File 'lib/a-core.rb', line 1018

def image_data
  @image_data
end

#item_objObject (readonly)

Returns the value of attribute item_obj.



1019
1020
1021
# File 'lib/a-core.rb', line 1019

def item_obj
  @item_obj
end

#nameObject

Returns the value of attribute name.



1009
1010
1011
# File 'lib/a-core.rb', line 1009

def name
  @name
end

#rifObject

Returns the value of attribute rif.



1010
1011
1012
# File 'lib/a-core.rb', line 1010

def rif
  @rif
end

Instance Method Details

#backgroundObject



1044
1045
# File 'lib/a-core.rb', line 1044

def background
end

#enable=(_value) ⇒ Object



1041
1042
# File 'lib/a-core.rb', line 1041

def enable=(_value)
end

#foregroundObject



1047
1048
# File 'lib/a-core.rb', line 1047

def foreground
end