Class: AppMap::Config::Package

Inherits:
Struct
  • Object
show all
Defined in:
lib/appmap/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#excludeObject

Returns the value of attribute exclude

Returns:

  • (Object)

    the current value of exclude



5
6
7
# File 'lib/appmap/config.rb', line 5

def exclude
  @exclude
end

#gemObject

Returns the value of attribute gem

Returns:

  • (Object)

    the current value of gem



5
6
7
# File 'lib/appmap/config.rb', line 5

def gem
  @gem
end

#labelsObject

Returns the value of attribute labels

Returns:

  • (Object)

    the current value of labels



5
6
7
# File 'lib/appmap/config.rb', line 5

def labels
  @labels
end

#package_nameObject

Returns the value of attribute package_name

Returns:

  • (Object)

    the current value of package_name



5
6
7
# File 'lib/appmap/config.rb', line 5

def package_name
  @package_name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



5
6
7
# File 'lib/appmap/config.rb', line 5

def path
  @path
end

Class Method Details

.build_from_gem(gem, package_name: nil, exclude: [], labels: []) ⇒ Object



11
12
13
14
15
# File 'lib/appmap/config.rb', line 11

def build_from_gem(gem, package_name: nil, exclude: [], labels: [])
  gem_paths(gem).map do |gem_path|
    Package.new(gem_path, gem, package_name, exclude, labels)
  end
end

.build_from_path(path, package_name: nil, exclude: [], labels: []) ⇒ Object



7
8
9
# File 'lib/appmap/config.rb', line 7

def build_from_path(path, package_name: nil, exclude: [], labels: [])
  Package.new(path, nil, package_name, exclude, labels)
end

Instance Method Details

#nameObject



29
30
31
# File 'lib/appmap/config.rb', line 29

def name
  gem || path
end

#to_hObject



33
34
35
36
37
38
39
40
41
# File 'lib/appmap/config.rb', line 33

def to_h
  {
    path: path,
    package_name: package_name,
    gem: gem,
    exclude: exclude.blank? ? nil : exclude,
    labels: labels.blank? ? nil : labels
  }.compact
end