class RubyTerraform::Options::Name

Public Class Methods

new(name) click to toggle source
Calls superclass method
# File lib/ruby_terraform/options/name.rb, line 8
def initialize(name)
  super(name: name.to_s)
end

Public Instance Methods

as_plural_key() click to toggle source
# File lib/ruby_terraform/options/name.rb, line 22
def as_plural_key
  "#{snake_case}s".to_sym
end
as_singular_key() click to toggle source
# File lib/ruby_terraform/options/name.rb, line 18
def as_singular_key
  snake_case.to_sym
end
name() click to toggle source
# File lib/ruby_terraform/options/name.rb, line 12
def name
  "-#{without_prefix}"
end
Also aliased as: to_s
to_s()
Alias for: name

Private Instance Methods

snake_case() click to toggle source
# File lib/ruby_terraform/options/name.rb, line 32
def snake_case
  without_prefix.gsub('-', '_')
end
without_prefix() click to toggle source
# File lib/ruby_terraform/options/name.rb, line 28
def without_prefix
  @name.sub(/^-+/, '')
end