Class: Elasticity::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticity/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Application

Returns a new instance of Application



9
10
11
12
13
14
# File 'lib/elasticity/application.rb', line 9

def initialize(args)
  @name = args[:name]
  @arguments = args[:arguments]
  @version = args[:version]
  @additional_info = args[:additional_info]
end

Instance Attribute Details

#additional_infoObject

Returns the value of attribute additional_info



7
8
9
# File 'lib/elasticity/application.rb', line 7

def additional_info
  @additional_info
end

#argumentsObject

Returns the value of attribute arguments



5
6
7
# File 'lib/elasticity/application.rb', line 5

def arguments
  @arguments
end

#nameObject

Returns the value of attribute name



4
5
6
# File 'lib/elasticity/application.rb', line 4

def name
  @name
end

#versionObject

Returns the value of attribute version



6
7
8
# File 'lib/elasticity/application.rb', line 6

def version
  @version
end

Instance Method Details

#to_hashObject



16
17
18
19
20
21
22
23
24
# File 'lib/elasticity/application.rb', line 16

def to_hash
  application = {
    name: @name
  }
  application[:args] = @arguments unless @arguments.nil? || @arguments.empty?
  application[:version] = @version if @version
  application[:additional_info] = @additional_info if @additional_info
  application
end