Class: Jnlp::Icon
- Inherits:
-
Object
- Object
- Jnlp::Icon
- 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
-
#height ⇒ Object
readonly
Contains the height attribute of the <icon> element.
-
#href ⇒ Object
readonly
Contains the href attribute of the <icon> element.
-
#icon ⇒ Object
readonly
Contains the Hpricot element parsed from the orginal Jnlp that was used to create the Icon.
-
#width ⇒ Object
readonly
Contains the width attribute of the <icon> element.
Instance Method Summary collapse
-
#initialize(icon) ⇒ Icon
constructor
Creates a new Icon object * icon: pass in a Hpricot parse of the <icon> element.
Constructor Details
#initialize(icon) ⇒ Icon
Creates a new Icon object
-
icon: pass in a Hpricot parse of the <icon> element
207 208 209 210 211 212 |
# File 'lib/jnlp/jnlp.rb', line 207 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
#height ⇒ Object (readonly)
Contains the height attribute of the <icon> element
Example:
64
194 195 196 |
# File 'lib/jnlp/jnlp.rb', line 194 def height @height end |
#href ⇒ Object (readonly)
Contains the href attribute of the <icon> element.
Example:
"http://itsi.concord.org/images/itsi-logo-64x64.png"
186 187 188 |
# File 'lib/jnlp/jnlp.rb', line 186 def href @href end |
#icon ⇒ Object (readonly)
Contains the Hpricot element parsed from the orginal Jnlp that was used to create the Icon
178 179 180 |
# File 'lib/jnlp/jnlp.rb', line 178 def icon @icon end |
#width ⇒ Object (readonly)
Contains the width attribute of the <icon> element
Example:
64
202 203 204 |
# File 'lib/jnlp/jnlp.rb', line 202 def width @width end |