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

#initialize(icon) ⇒ 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

#heightObject (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

#hrefObject (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

#iconObject (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

#widthObject (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