Class: OpenSandbox::Endpoint
- Inherits:
-
Data
- Object
- Data
- OpenSandbox::Endpoint
- Defined in:
- lib/open_sandbox/models.rb
Overview
Value object for an Endpoint
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint
52 53 54 |
# File 'lib/open_sandbox/models.rb', line 52 def endpoint @endpoint end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers
52 53 54 |
# File 'lib/open_sandbox/models.rb', line 52 def headers @headers end |
Class Method Details
.from_hash(h) ⇒ Object
53 54 55 |
# File 'lib/open_sandbox/models.rb', line 53 def self.from_hash(h) new(endpoint: h["endpoint"], headers: h["headers"] || {}) end |
Instance Method Details
#url ⇒ Object
57 |
# File 'lib/open_sandbox/models.rb', line 57 def url = endpoint.start_with?("http") ? endpoint : "http://#{endpoint}" |