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.



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

def initialize(...)
  super
  freeze
end

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



7
8
9
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 7

def name
  @name
end

#time_frameObject

Returns the value of attribute time_frame

Returns:

  • (Object)

    the current value of time_frame



7
8
9
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 7

def time_frame
  @time_frame
end

#value_typeObject

Returns the value of attribute value_type

Returns:

  • (Object)

    the current value of value_type



7
8
9
# File 'lib/generators/gitlab/usage_metric_definition_generator.rb', line 7

def value_type
  @value_type
end

Instance Method Details

#match?(str) ⇒ Boolean

Returns:

  • (Boolean)


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

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