Class: CssDryer::Processor::StyleHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/css_dryer_2/processor.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*a, &b) ⇒ StyleHash

Returns a new instance of StyleHash.



305
306
307
308
# File 'lib/css_dryer_2/processor.rb', line 305

def initialize *a, &b
  super
  multiline = false
end

Instance Attribute Details

#multilineObject

Returns the value of attribute multiline.



304
305
306
# File 'lib/css_dryer_2/processor.rb', line 304

def multiline
  @multiline
end

Instance Method Details

#has_non_style_hash_childrenObject



309
310
311
312
313
314
315
# File 'lib/css_dryer_2/processor.rb', line 309

def has_non_style_hash_children
  value.each do |elem|
    next if elem.kind_of? StyleHash
    return true unless elem.blank?
  end
  false
end

#keyObject

We only ever have one key and one value



317
318
319
# File 'lib/css_dryer_2/processor.rb', line 317

def key
  self.keys.first
end

#key=(key) ⇒ Object



320
321
322
# File 'lib/css_dryer_2/processor.rb', line 320

def key=(key)
  self.keys.first = key
end

#valueObject



323
324
325
# File 'lib/css_dryer_2/processor.rb', line 323

def value
  self.values.first
end

#value=(value) ⇒ Object



326
327
328
# File 'lib/css_dryer_2/processor.rb', line 326

def value=(value)
  self.values.first = value
end