Class: Nucleo::Models::Changes

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/nucleo/models/changes.rb

Instance Method Summary collapse

Constructor Details

#initialize(collection) ⇒ Nucleo::Models::Changes

Return an instance of the Rules collection domain model

Parameters:

  • collection (Array)


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.

Returns:

  • (Nucleo::Models::ChangeType)


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