Class: Middleman::PreviewServer::ServerInformationCallbackProxy
- Inherits:
- 
      Object
      
        - Object
- Middleman::PreviewServer::ServerInformationCallbackProxy
 
- Defined in:
- lib/middleman-core/preview_server/server_information_callback_proxy.rb
Overview
This class wraps server information to be used in call back
- listeners
- port
- server name
- site_addresses
All information is "dupped" and the callback is not meant to be used to modify these information.
Instance Attribute Summary collapse
- 
  
    
      #listeners  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute listeners. 
- 
  
    
      #port  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute port. 
- 
  
    
      #server_name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute server_name. 
- 
  
    
      #site_addresses  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute site_addresses. 
Instance Method Summary collapse
- 
  
    
      #initialize(server_information)  ⇒ ServerInformationCallbackProxy 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ServerInformationCallbackProxy. 
Constructor Details
#initialize(server_information) ⇒ ServerInformationCallbackProxy
Returns a new instance of ServerInformationCallbackProxy.
| 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # File 'lib/middleman-core/preview_server/server_information_callback_proxy.rb', line 15 def initialize(server_information) @listeners = ServerUrl.new( hosts: server_information.listeners, port: server_information.port, https: server_information.https?, format_output: false ).to_bind_addresses @port = server_information.port @server_name = server_information.server_name.dup unless server_information.server_name.nil? @site_addresses = ServerUrl.new( hosts: server_information.site_addresses, port: server_information.port, https: server_information.https?, format_output: false ).to_urls end | 
Instance Attribute Details
#listeners ⇒ Object (readonly)
Returns the value of attribute listeners.
| 13 14 15 | # File 'lib/middleman-core/preview_server/server_information_callback_proxy.rb', line 13 def listeners @listeners end | 
#port ⇒ Object (readonly)
Returns the value of attribute port.
| 13 14 15 | # File 'lib/middleman-core/preview_server/server_information_callback_proxy.rb', line 13 def port @port end | 
#server_name ⇒ Object (readonly)
Returns the value of attribute server_name.
| 13 14 15 | # File 'lib/middleman-core/preview_server/server_information_callback_proxy.rb', line 13 def server_name @server_name end | 
#site_addresses ⇒ Object (readonly)
Returns the value of attribute site_addresses.
| 13 14 15 | # File 'lib/middleman-core/preview_server/server_information_callback_proxy.rb', line 13 def site_addresses @site_addresses end |