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