Class: Vx::Builder::BuildConfiguration::Deploy::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/vx/builder/build_configuration/deploy/provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(new_attributes) ⇒ Provider

Returns a new instance of Provider.



10
11
12
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 10

def initialize(new_attributes)
  normalize new_attributes.dup
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 8

def name
  @name
end

#onObject (readonly)

Returns the value of attribute on.



8
9
10
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 8

def on
  @on
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 8

def options
  @options
end

Instance Method Details

#branch?(branch) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 14

def branch?(branch)
  return true if on.empty?
  on.include?(branch)
end

#commandObject



30
31
32
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 30

def command
  Array(options["command"])
end

#shell?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 26

def shell?
  @name == 'shell'
end

#to_hashObject



19
20
21
22
23
24
# File 'lib/vx/builder/build_configuration/deploy/provider.rb', line 19

def to_hash
  options.merge(
    "provider" => @name,
    "branch"   => on
  )
end