Class: Gitlab::UsageMetricDefinitionGenerator::Directory

Inherits:
Struct
  • Object
show all
Defined in:
lib/generators/gitlab/usage_metric_definition_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDirectory

Returns a new instance of Directory.



11
12
13
14
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 11

def initialize(...)
  super
  freeze
end

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



10
11
12
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 10

def name
  @name
end

#time_frameObject

Returns the value of attribute time_frame

Returns:

  • (Object)

    the current value of time_frame



10
11
12
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 10

def time_frame
  @time_frame
end

#value_typeObject

Returns the value of attribute value_type

Returns:

  • (Object)

    the current value of value_type



10
11
12
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 10

def value_type
  @value_type
end

Instance Method Details

#match?(str) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 16

def match?(str)
  (name == str || time_frame == str) && str != 'none'
end