Class: Hokuto::Application

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Application

Returns a new instance of Application.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hokuto/application.rb', line 17

def initialize(args)

  @context = WebAppContext.new

  if args[:descriptor]
    context.descriptor = args[:descriptor]
  else
    @environment = args[:environment]
    @context_root = args[:context_root]
    @base_directory = args[:base_directory]
    @min_instances = args[:min_instances]
    @max_instances = args[:max_instances]

    setup_context
  end
end

Instance Attribute Details

#base_directoryObject (readonly)

Returns the value of attribute base_directory.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def base_directory
  @base_directory
end

#contextObject (readonly)

Returns the value of attribute context.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def context
  @context
end

#context_rootObject (readonly)

Returns the value of attribute context_root.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def context_root
  @context_root
end

#descriptorObject (readonly)

Returns the value of attribute descriptor.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def descriptor
  @descriptor
end

#environmentObject (readonly)

Returns the value of attribute environment.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def environment
  @environment
end

#max_instancesObject (readonly)

Returns the value of attribute max_instances.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def max_instances
  @max_instances
end

#min_instancesObject (readonly)

Returns the value of attribute min_instances.



14
15
16
# File 'lib/hokuto/application.rb', line 14

def min_instances
  @min_instances
end

Instance Method Details

#==(other) ⇒ Object



34
35
36
37
# File 'lib/hokuto/application.rb', line 34

def ==(other)
  return false unless other.kind_of? Application
  other.context_root == context_root
end