Class: Nucleus::Provider
- Inherits:
-
AbstractModel
- Object
- AbstractModel
- Nucleus::Provider
- Includes:
- Kwalify::Util::HashLike
- Defined in:
- lib/nucleus/core/models/provider.rb
Overview
The Provider model will initially be imported from .yaml
description files and shall be persisted in the store. The provider has the following properties:
-
id (String)
-
name (String)
-
vendor (Nucleus::Vendor)
-
endpoints (Array<Nucleus::Endpoint>)
Instance Attribute Summary collapse
Attributes inherited from AbstractModel
#created_at, #id, #name, #updated_at
Instance Method Summary collapse
-
#initialize(hash = nil) ⇒ Provider
constructor
A new instance of Provider.
Methods inherited from AbstractModel
Constructor Details
#initialize(hash = nil) ⇒ Provider
Returns a new instance of Provider.
17 18 19 20 21 22 23 24 |
# File 'lib/nucleus/core/models/provider.rb', line 17 def initialize(hash = nil) super(hash) @endpoints = [] return if hash.nil? return unless hash.key?('endpoints') @endpoints = hash['endpoints'].map! { |e| e.is_a?(Nucleus::Endpoint) ? e : Nucleus::Endpoint.new(e) } end |
Instance Attribute Details
#endpoints ⇒ Object
seq
15 16 17 |
# File 'lib/nucleus/core/models/provider.rb', line 15 def endpoints @endpoints end |
#vendor ⇒ Object
14 15 16 |
# File 'lib/nucleus/core/models/provider.rb', line 14 def vendor @vendor end |