Class: Nucleus::Endpoint

Inherits:
AbstractModel show all
Includes:
Kwalify::Util::HashLike
Defined in:
lib/nucleus/core/models/endpoint.rb

Overview

The Endpoint model will initially be imported from .yaml description files and shall be persisted in the store. The endpoint has the following properties:

  • id (String)

  • name (String)

  • provider (Nucleus::Provider)

  • url (String)

  • app_domain (String)

  • trust (Boolean)

Author:

Since:

  • 0.1.0

Instance Attribute Summary collapse

Attributes inherited from AbstractModel

#created_at, #id, #name, #updated_at

Instance Method Summary collapse

Methods inherited from AbstractModel

#inspect, #to_s

Constructor Details

#initialize(hash = nil) ⇒ Endpoint

Returns a new instance of Endpoint.

Since:

  • 0.1.0



21
22
23
24
25
26
27
28
# File 'lib/nucleus/core/models/endpoint.rb', line 21

def initialize(hash = nil)
  super(hash)
  @trust = false
  return if hash.nil?
  @url = hash['url']
  @app_domain = hash['app_domain']
  @trust = hash['trust'] if hash.key?('trust')
end

Instance Attribute Details

#app_domainObject

str

Since:

  • 0.1.0



18
19
20
# File 'lib/nucleus/core/models/endpoint.rb', line 18

def app_domain
  @app_domain
end

#providerObject

Since:

  • 0.1.0



16
17
18
# File 'lib/nucleus/core/models/endpoint.rb', line 16

def provider
  @provider
end

#trustObject

bool

Since:

  • 0.1.0



19
20
21
# File 'lib/nucleus/core/models/endpoint.rb', line 19

def trust
  @trust
end

#urlObject

str

Since:

  • 0.1.0



17
18
19
# File 'lib/nucleus/core/models/endpoint.rb', line 17

def url
  @url
end