Class: Style

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

Instance Method Summary collapse

Constructor Details

#initialize(parent, h) ⇒ Style

Returns a new instance of Style.



12
13
14
15
16
17
# File 'lib/domle.rb', line 12

def initialize(parent, h)
  @parent = parent

  super().merge! h

end

Instance Method Details

#[]=(k, v) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/domle.rb', line 19

def []=(k,v)

  super(k,v)
  @parent[:style] = self.map{|x| x.join(':') }.join(';')

  if @parent.callback and @parent.callback.respond_to? :refresh then
    @parent.callback.refresh
  end

end