Class: Glimmer::SWT::ImageProxy
- Inherits:
-
Object
- Object
- Glimmer::SWT::ImageProxy
- Defined in:
- lib/glimmer/swt/image_proxy.rb
Overview
emulating org.eclipse.swt.graphics.Image
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ ImageProxy
constructor
A new instance of ImageProxy.
Constructor Details
#initialize(*args) ⇒ ImageProxy
Returns a new instance of ImageProxy.
17 18 19 20 21 22 23 |
# File 'lib/glimmer/swt/image_proxy.rb', line 17 def initialize(*args) = args.last.is_a?(Hash) ? args.last : {} # TODO support a parent as a first argument before the file path @file_path = args.first @width = [:width] @height = [:height] end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
15 16 17 |
# File 'lib/glimmer/swt/image_proxy.rb', line 15 def file_path @file_path end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
15 16 17 |
# File 'lib/glimmer/swt/image_proxy.rb', line 15 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
15 16 17 |
# File 'lib/glimmer/swt/image_proxy.rb', line 15 def width @width end |
Class Method Details
.create(*args, &content) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/glimmer/swt/image_proxy.rb', line 6 def create(*args, &content) if args.size == 1 && args.first.is_a?(ImageProxy) args.first else new(*args, &content) end end |