Class: CTioga2::Graphics::Styles::StyleSheet::Bucket
- Inherits:
-
Object
- Object
- CTioga2::Graphics::Styles::StyleSheet::Bucket
- Defined in:
- lib/ctioga2/graphics/styles/stylesheet.rb
Overview
A style bucket, a hash ‘key’ => ‘value’ associated with a unique xpath
Instance Attribute Summary collapse
-
#style ⇒ Object
The style information (a string->string hash).
-
#xname ⇒ Object
The xpath text initially used.
-
#xpath ⇒ Object
All the XPath associated with this style information.
Instance Method Summary collapse
-
#initialize(xp) ⇒ Bucket
constructor
A new instance of Bucket.
- #matches?(obj) ⇒ Boolean
-
#normalized_style ⇒ Object
Returns the style, but with all the options normalized to lowercase and without.
Constructor Details
Instance Attribute Details
#style ⇒ Object
The style information (a string->string hash).
Not that it can actually be a string->typed stuff, since most types accept that !
203 204 205 |
# File 'lib/ctioga2/graphics/styles/stylesheet.rb', line 203 def style @style end |
#xname ⇒ Object
The xpath text initially used
209 210 211 |
# File 'lib/ctioga2/graphics/styles/stylesheet.rb', line 209 def xname @xname end |
#xpath ⇒ Object
All the XPath associated with this style information
206 207 208 |
# File 'lib/ctioga2/graphics/styles/stylesheet.rb', line 206 def xpath @xpath end |
Instance Method Details
#matches?(obj) ⇒ Boolean
217 218 219 220 221 222 223 |
# File 'lib/ctioga2/graphics/styles/stylesheet.rb', line 217 def matches?(obj) if @xpath.matches?(obj) return true else return false end end |
#normalized_style ⇒ Object
Returns the style, but with all the options normalized to lowercase and without
227 228 229 230 231 232 233 |
# File 'lib/ctioga2/graphics/styles/stylesheet.rb', line 227 def normalized_style stl = {} for k,v in @style stl[k.gsub(/-/,"_").downcase] = v end return stl end |