Class: SVG::ECMAScript
- Inherits:
-
Object
- Object
- SVG::ECMAScript
- Defined in:
- lib/ruby-svg/core.rb
Overview
#
ECMAScript Class
Instance Attribute Summary collapse
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
-
#initialize(script) ⇒ ECMAScript
constructor
A new instance of ECMAScript.
- #to_s ⇒ Object
Constructor Details
#initialize(script) ⇒ ECMAScript
Returns a new instance of ECMAScript.
109 110 111 |
# File 'lib/ruby-svg/core.rb', line 109 def initialize(script) @script = script end |
Instance Attribute Details
#script ⇒ Object
Returns the value of attribute script.
113 114 115 |
# File 'lib/ruby-svg/core.rb', line 113 def script @script end |
Instance Method Details
#to_s ⇒ Object
115 116 117 118 119 120 |
# File 'lib/ruby-svg/core.rb', line 115 def to_s text = %|<script type="text/ecmascript"><![CDATA[\n| text << @script << "\n" text << %|]]></script>\n| return text end |