Class: Sol::CSSRules

Inherits:
Object
  • Object
show all
Defined in:
lib/jx/jsstyle_sheet.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(style_sheet) ⇒ CSSRules





85
86
87
88
89
90
# File 'lib/jx/jsstyle_sheet.rb', line 85

def initialize(style_sheet)
  p "rules #{style_sheet}"
  @jsvar = "css_rules_#{SecureRandom.hex(8)}"
  p B.eval("#{style_sheet}.rules")
  # B.eval("var #{@jsvar} = #{style_sheet}.cssRules")
end

Instance Attribute Details

#jsvarObject (readonly)

Returns the value of attribute jsvar.



79
80
81
# File 'lib/jx/jsstyle_sheet.rb', line 79

def jsvar
  @jsvar
end

Instance Method Details

#[](index) ⇒ Object





96
97
98
99
100
# File 'lib/jx/jsstyle_sheet.rb', line 96

def [](index)
  # p @jsvar
  B.eval("console.log(#{@jsvar})")
  CSSRule.new(@jsvar, index)
end