Class: DYI::Script::ScriptReference

Inherits:
SimpleScript show all
Defined in:
lib/dyi/script/simple_script.rb

Overview

Class representing a referenct of external client-script-file. The scripting becomes effective only when it is output by SVG format.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Attributes inherited from SimpleScript

#body, #content_type

Instance Method Summary collapse

Methods inherited from SimpleScript

#append_body, #contents, #write_as

Constructor Details

#initialize(href, content_type = 'application/ecmascript') ⇒ ScriptReference

Returns a new instance of ScriptReference.

Since:

  • 1.0.0



87
88
89
90
# File 'lib/dyi/script/simple_script.rb', line 87

def initialize(href, content_type = 'application/ecmascript')
  super(nil, content_type)
  @href = href
end

Instance Attribute Details

#hrefString (readonly)

Returns a path of external script file.

Returns:

  • (String)

    a path of external script file

Since:

  • 1.0.0



85
86
87
# File 'lib/dyi/script/simple_script.rb', line 85

def href
  @href
end

Instance Method Details

#has_uri_reference?Boolean

Returns whether this script contains reference of external script file.

Returns:

  • (Boolean)

    always returns true

Since:

  • 1.0.0



100
101
102
# File 'lib/dyi/script/simple_script.rb', line 100

def has_uri_reference?
  true
end

#include_external_file?Boolean

Returns whether this script contains reference of external script file.

Returns:

  • (Boolean)

    always returns true

Since:

  • 1.0.0



94
95
96
# File 'lib/dyi/script/simple_script.rb', line 94

def include_external_file?
  true
end