Class: Spoom::Coverage::D3::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/spoom/coverage/d3/base.rb

Overview

This class is abstract.

Direct Known Subclasses

CircleMap, Pie, Timeline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, data) ⇒ Base

: (String id, untyped data) -> void



13
14
15
16
# File 'lib/spoom/coverage/d3/base.rb', line 13

def initialize(id, data)
  @id = id
  @data = data
end

Instance Attribute Details

#idObject (readonly)

: String



10
11
12
# File 'lib/spoom/coverage/d3/base.rb', line 10

def id
  @id
end

Class Method Details

.header_scriptObject

: -> String



25
26
27
# File 'lib/spoom/coverage/d3/base.rb', line 25

def header_script
  ""
end

.header_styleObject

: -> String



20
21
22
# File 'lib/spoom/coverage/d3/base.rb', line 20

def header_style
  ""
end

Instance Method Details

#htmlObject

: -> String



31
32
33
34
35
36
# File 'lib/spoom/coverage/d3/base.rb', line 31

def html
  <<~HTML
    <svg id="#{id}"></svg>
    <script>#{script}</script>
  HTML
end

#scriptObject

This method is abstract.

: -> String

Raises:

  • (NotImplementedError)


45
# File 'lib/spoom/coverage/d3/base.rb', line 45

def script = raise NotImplementedError, "Abstract method called"

#tooltipObject

: -> String



39
40
41
# File 'lib/spoom/coverage/d3/base.rb', line 39

def tooltip
  ""
end