Class: Nucleo::Models::Changes
- Inherits:
-
Object
- Object
- Nucleo::Models::Changes
- Includes:
- Enumerable
- Defined in:
- lib/nucleo/models/changes.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#find_by_id(id) ⇒ Nucleo::Models::ChangeType
Retrieve a rule by the ID.
-
#initialize(collection) ⇒ Nucleo::Models::Changes
constructor
Return an instance of the Rules collection domain model.
- #push(args) ⇒ Object
Constructor Details
#initialize(collection) ⇒ Nucleo::Models::Changes
Return an instance of the Rules collection domain model
11 12 13 |
# File 'lib/nucleo/models/changes.rb', line 11 def initialize(collection) @collection = Array(collection) end |
Instance Method Details
#each(&block) ⇒ Object
15 16 17 |
# File 'lib/nucleo/models/changes.rb', line 15 def each(&block) internal_collection.each(&block) end |
#find_by_id(id) ⇒ Nucleo::Models::ChangeType
Retrieve a rule by the ID.
26 27 28 |
# File 'lib/nucleo/models/changes.rb', line 26 def find_by_id(id) self.find { |record| record.id == id.to_s } end |
#push(args) ⇒ Object
19 20 21 |
# File 'lib/nucleo/models/changes.rb', line 19 def push(args) @collection.push(args) end |