Class: RubyTerraform::Options::Name
- Inherits:
-
Object
- Object
- RubyTerraform::Options::Name
- Defined in:
- lib/ruby_terraform/options/name.rb
Instance Method Summary collapse
- #as_plural_key ⇒ Object
- #as_singular_key ⇒ Object
-
#initialize(name) ⇒ Name
constructor
A new instance of Name.
- #name ⇒ Object (also: #to_s)
Constructor Details
#initialize(name) ⇒ Name
Returns a new instance of Name.
8 9 10 |
# File 'lib/ruby_terraform/options/name.rb', line 8 def initialize(name) super(name: name.to_s) end |
Instance Method Details
#as_plural_key ⇒ Object
22 23 24 |
# File 'lib/ruby_terraform/options/name.rb', line 22 def as_plural_key :"#{snake_case}s" end |
#as_singular_key ⇒ Object
18 19 20 |
# File 'lib/ruby_terraform/options/name.rb', line 18 def as_singular_key snake_case.to_sym end |
#name ⇒ Object Also known as: to_s
12 13 14 |
# File 'lib/ruby_terraform/options/name.rb', line 12 def name "-#{without_prefix}" end |