Class: BubbleGraph
- Inherits:
-
Object
- Object
- BubbleGraph
- Defined in:
- lib/bubbler/bubble_graph.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #as_d3_hash ⇒ Object
-
#initialize(args) ⇒ BubbleGraph
constructor
A new instance of BubbleGraph.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(args) ⇒ BubbleGraph
Returns a new instance of BubbleGraph.
6 7 8 9 |
# File 'lib/bubbler/bubble_graph.rb', line 6 def initialize args @name = args[:name] @data = args[:data] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/bubbler/bubble_graph.rb', line 4 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/bubbler/bubble_graph.rb', line 4 def name @name end |
Instance Method Details
#as_d3_hash ⇒ Object
15 16 17 |
# File 'lib/bubbler/bubble_graph.rb', line 15 def as_d3_hash { children: @data } end |
#to_json(options = {}) ⇒ Object
11 12 13 |
# File 'lib/bubbler/bubble_graph.rb', line 11 def to_json ={} self.as_d3_hash.to_json end |