Class: RuboCop::Schema::Spec

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubocop/schema/value_objects.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



12
13
14
# File 'lib/rubocop/schema/value_objects.rb', line 12

def name
  @name
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



12
13
14
# File 'lib/rubocop/schema/value_objects.rb', line 12

def version
  @version
end

Instance Method Details

#short_nameObject



13
14
15
16
17
# File 'lib/rubocop/schema/value_objects.rb', line 13

def short_name
  return nil if name == 'rubocop'

  name[8..-1]
end

#to_sObject



19
20
21
# File 'lib/rubocop/schema/value_objects.rb', line 19

def to_s
  "#{short_name || name}-#{version}"
end