Class: SeedSortToolkit::SortableSeedYaml
- Inherits:
-
Object
- Object
- SeedSortToolkit::SortableSeedYaml
- Defined in:
- lib/seed_sort_toolkit/sortable_seed_yaml.rb
Instance Method Summary collapse
-
#initialize(seed) ⇒ SortableSeedYaml
constructor
A new instance of SortableSeedYaml.
- #sort(&block) ⇒ Object
- #sort_by(&block) ⇒ Object
Constructor Details
#initialize(seed) ⇒ SortableSeedYaml
Returns a new instance of SortableSeedYaml.
5 6 7 8 |
# File 'lib/seed_sort_toolkit/sortable_seed_yaml.rb', line 5 def initialize(seed) seed = AccessibleSeedYaml::Table.new(seed) @records = seed.records end |
Instance Method Details
#sort(&block) ⇒ Object
15 16 17 18 |
# File 'lib/seed_sort_toolkit/sortable_seed_yaml.rb', line 15 def sort(&block) @records.sort!(&block) fetch_seed end |
#sort_by(&block) ⇒ Object
10 11 12 13 |
# File 'lib/seed_sort_toolkit/sortable_seed_yaml.rb', line 10 def sort_by(&block) @records.sort_by!(&block) fetch_seed end |