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
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
#height ⇒ Object (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 |
#href ⇒ Object (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 |
#icon ⇒ Object (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 |
#width ⇒ Object (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 |