Class: Kamal::Configuration::Alias

Inherits:
Object
  • Object
show all
Includes:
Validation
Defined in:
lib/kamal/configuration/alias.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validation

#validate!, #validation_yml

Constructor Details

#initialize(name, config:) ⇒ Alias

Returns a new instance of Alias.



6
7
8
9
10
11
12
13
14
# File 'lib/kamal/configuration/alias.rb', line 6

def initialize(name, config:)
  @name, @command = name.inquiry, config.raw_config["aliases"][name]

  validate! \
    command,
    example: validation_yml["aliases"]["uname"],
    context: "aliases/#{name}",
    with: Kamal::Configuration::Validator::Alias
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



4
5
6
# File 'lib/kamal/configuration/alias.rb', line 4

def command
  @command
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/kamal/configuration/alias.rb', line 4

def name
  @name
end