Class: BubbleDataCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/bubbler/bubble_data_collector.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ BubbleDataCollector

Returns a new instance of BubbleDataCollector.



5
6
7
8
9
10
# File 'lib/bubbler/bubble_data_collector.rb', line 5

def initialize args
  @group     = args[:group]
  @path      = args[:path]
  @match     = args[:match]
  @recursive = args.fetch(:recursive, false)
end

Class Method Details

.new_from_json(json, base_path) ⇒ Object



12
13
14
15
16
# File 'lib/bubbler/bubble_data_collector.rb', line 12

def self.new_from_json json, base_path
  base_path << '/' if base_path[-1] != '/'
  new(group: json["group"], path: base_path + json["path"],
      match: json["match"], recursive: json["recursive"])
end

Instance Method Details

#create_graphObject



18
19
20
21
22
# File 'lib/bubbler/bubble_data_collector.rb', line 18

def create_graph
  files = collect_files(@path, @match, @recursive)
  bubbles = create_bubbles_from_files(files, @path)
  BubbleGraph.new(name: @group, data: bubbles)
end