Class: Jnlp::Icon
- Inherits:
-
Object
- Object
- Jnlp::Icon
- 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
-
#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
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
#height ⇒ Object (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 |
#href ⇒ Object (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 |
#icon ⇒ Object (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 |
#width ⇒ Object (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 |