Class: Jnlp::Icon

Inherits:
Object
  • Object
show all
Defined in:
lib/jnlp/icon.rb

Overview

Icon objects encapsulate the <icon> element optionally present in the Java Web Start jnlp <information> element.

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Icon) initialize(icon)

Creates a new Icon object

  • icon: pass in a Hpricot parse of the <icon> element



41
42
43
44
45
46
# File 'lib/jnlp/icon.rb', line 41

def initialize(icon)
  @icon = icon
  @href = icon.attr('href').value
  @height = icon.attr('height').value.to_i
  @width = icon.attr('width').value.to_i
end

Instance Attribute Details

- (Object) height (readonly)

Contains the height attribute of the <icon> element

Example:

64


28
29
30
# File 'lib/jnlp/icon.rb', line 28

def height
  @height
end

- (Object) href (readonly)

Contains the href attribute of the <icon> element.

Example:

"http://itsi.concord.org/images/itsi-logo-64x64.png"


20
21
22
# File 'lib/jnlp/icon.rb', line 20

def href
  @href
end

- (Object) icon (readonly)

Contains the Hpricot element parsed from the orginal Jnlp that was used to create the Icon



12
13
14
# File 'lib/jnlp/icon.rb', line 12

def icon
  @icon
end

- (Object) width (readonly)

Contains the width attribute of the <icon> element

Example:

64


36
37
38
# File 'lib/jnlp/icon.rb', line 36

def width
  @width
end