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

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Defined in:
lib/spoom/coverage/d3/base.rb

Direct Known Subclasses

CircleMap, Pie, Timeline

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, data) ⇒ Base

Returns a new instance of Base.



17
18
19
20
# File 'lib/spoom/coverage/d3/base.rb', line 17

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Class Method Details

.header_scriptObject



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

def header_script
  ""
end

.header_styleObject



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

def header_style
  ""
end

Instance Method Details

#htmlObject



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

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

#scriptObject



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

def script; end

#tooltipObject



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

def tooltip
  ""
end