Class: Mooncell::ApplicationConfiguration Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mooncell/application_configuration.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The Application Configruation

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ ApplicationConfiguration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create new configuration

Parameters:

  • block (Proc)

    the configuration block

Since:

  • 0.1.0



17
18
19
20
# File 'lib/mooncell/application_configuration.rb', line 17

def initialize(&block)
  @settings = {}
  instance_eval(&block)
end

Instance Method Details

#portNumber #port(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Port

Overloads:

  • #portNumber

    Get the port

    Returns:

    • (Number)

      the port

  • #port(value) ⇒ Object

    Set the port

    Parameters:

    • port (Number)

      the port

Since:

  • 0.1.0



54
55
56
57
58
# File 'lib/mooncell/application_configuration.rb', line 54

def port(value = nil)
  return settings[:port] if value.nil?

  settings[:port] = value.to_i
end

#protocolString #protocol(value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Protocol

Overloads:

  • #protocolString

    Get the protocol

    Returns:

    • (String)

      the protocol

  • #protocol(value) ⇒ Object

    Set the protocol

    Parameters:

    • protocol (String)

      the target protocol

Since:

  • 0.1.0



34
35
36
37
38
39
40
# File 'lib/mooncell/application_configuration.rb', line 34

def protocol(value = nil)
  if value
    settings[:protocol] = value.to_s
  else
    settings[:portocol] || Mooncell.configuration.protocol
  end
end