Class: Bubble
- Inherits:
-
Object
- Object
- Bubble
- Defined in:
- lib/bubbler/bubble.rb
Instance Method Summary collapse
- #as_d3_hash ⇒ Object
-
#initialize(args) ⇒ Bubble
constructor
A new instance of Bubble.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(args) ⇒ Bubble
Returns a new instance of Bubble.
3 4 5 6 7 |
# File 'lib/bubbler/bubble.rb', line 3 def initialize args @name = args[:name] @path = args[:path] @line_count = args[:line_count] end |
Instance Method Details
#as_d3_hash ⇒ Object
13 14 15 |
# File 'lib/bubbler/bubble.rb', line 13 def as_d3_hash { name: @name, path: @path, value: @line_count } end |
#to_json(options = {}) ⇒ Object
9 10 11 |
# File 'lib/bubbler/bubble.rb', line 9 def to_json ={} self.as_d3_hash.to_json end |