Class: MasterDataTool::MasterDataCollection
- Inherits:
-
Object
- Object
- MasterDataTool::MasterDataCollection
- Defined in:
- lib/master_data_tool/master_data_collection.rb
Instance Method Summary collapse
- #append(master_data:) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ MasterDataCollection
constructor
A new instance of MasterDataCollection.
- #to_a ⇒ Object
Constructor Details
#initialize ⇒ MasterDataCollection
Returns a new instance of MasterDataCollection.
5 6 7 |
# File 'lib/master_data_tool/master_data_collection.rb', line 5 def initialize @collection = [] end |
Instance Method Details
#append(master_data:) ⇒ Object
9 10 11 |
# File 'lib/master_data_tool/master_data_collection.rb', line 9 def append(master_data:) @collection << master_data end |
#each ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/master_data_tool/master_data_collection.rb', line 13 def each return enum_for(:each) unless block_given? @collection.sort_by(&:basename).each do |master_data| yield master_data end end |
#to_a ⇒ Object
21 22 23 |
# File 'lib/master_data_tool/master_data_collection.rb', line 21 def to_a each.to_a end |