Class: Jnlp::Icon

Inherits:
Object
  • Object
show all
Defined in:
lib/jnlp/jnlp.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



134
135
136
137
138
139
# File 'lib/jnlp/jnlp.rb', line 134

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

Instance Attribute Details

#heightObject (readonly)

Contains the height attribute of the <icon> element

Example:

64


121
122
123
# File 'lib/jnlp/jnlp.rb', line 121

def height
  @height
end

#hrefObject (readonly)

Contains the href attribute of the <icon> element.

Example:

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


113
114
115
# File 'lib/jnlp/jnlp.rb', line 113

def href
  @href
end

#iconObject (readonly)

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



105
106
107
# File 'lib/jnlp/jnlp.rb', line 105

def icon
  @icon
end

#widthObject (readonly)

Contains the width attribute of the <icon> element

Example:

64


129
130
131
# File 'lib/jnlp/jnlp.rb', line 129

def width
  @width
end