Class: CssDryer::Processor::StyleHash

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

Overview

:nodoc:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (StyleHash) initialize(*a, &b)

A new instance of StyleHash



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

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

Instance Attribute Details

- (Object) multiline

Returns the value of attribute multiline



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

def multiline
  @multiline
end

Instance Method Details

- (Object) has_non_style_hash_children



309
310
311
312
313
314
315
# File 'lib/css_dryer/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

- (Object) key

We only ever have one key and one value



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

def key
  self.keys.first
end

- (Object) key=(key)



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

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

- (Object) value



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

def value
  self.values.first
end

- (Object) value=(value)



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

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