summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora14m <[email protected]>2020-12-10 21:39:09 +0100
committera14m <[email protected]>2020-12-10 21:39:09 +0100
commit8928e27b37624babab9a7cd570a1349d3c850d03 (patch)
treeaf88d51e151393af25b723f03349949253341898
parentb795db0ff7cd09de33cb3b4133563c7971e2fbc2 (diff)
Update yard docs and references
-rw-r--r--CLI/ruby/lib/game_of_life/generators/seed.rb8
-rw-r--r--CLI/ruby/lib/game_of_life/version.rb1
2 files changed, 7 insertions, 2 deletions
diff --git a/CLI/ruby/lib/game_of_life/generators/seed.rb b/CLI/ruby/lib/game_of_life/generators/seed.rb
index 917c9af..22be789 100644
--- a/CLI/ruby/lib/game_of_life/generators/seed.rb
+++ b/CLI/ruby/lib/game_of_life/generators/seed.rb
@@ -11,20 +11,23 @@ module GameOfLife
# @option options [Numeric] "width" (floored) and used as the width of the universe
# @option options [Numeric] "height" (floored) and used as the height of the universe
# @return [GameOfLife::Universe] populated with the parsed input
+ # @see ::GameOfLife::Generators::Seed.generate_seed_data
+ # @see ::GameOfLife::Generators::Seed.populate
def new(options)
width = options["width"].to_i
height = options["height"].to_i
seed = options["seed"].to_i
- input = generate_seed_data(seed: seed, width: width, height: height)
+ input = generate_seed_data(seed: seed, width: width, height: height)
populate(input: input, width: width, height: height)
end
# Generate the seeding data for populating the {GameOfLife::Universe}
- # @param seed [Integer] used to generate {Array<"0"|"1">} using Std ruby {Random}
+ # @param seed [Integer] used to generate {Array<"0"|"1">} using Std ruby Random
# @param width [Integer] width of the generated cyclic universe
# @param height [Integer] height of the generated cyclic universe
# @return [Array<Array<True|False>>] covering the defined size of universe
# @see ::GameOfLife::Generators::Seed.populate
+ # @see https://ruby-doc.org/core-2.4.0/Random.html
private def generate_seed_data(seed:, width:, height:)
# Create a pseudo(stable) random generator from the seed
# Generate a sequence of bytes to cover the Game of Life Universe plane
@@ -38,6 +41,7 @@ module GameOfLife
# @param width [Integer] width of the generated cyclic universe
# @param height [Integer] height of the generated cyclic universe
# @return [GameOfLife::Universe] populated with the parsed input
+ # @see ::GameOfLife::Generators::Seed.generate_seed_data
private def populate(input:, width:, height:)
# Generate a universe based on the parsed raw file and fill it with the cells
universe = GameOfLife::Universe.new(height: height, width: width)
diff --git a/CLI/ruby/lib/game_of_life/version.rb b/CLI/ruby/lib/game_of_life/version.rb
index 5fd800a..1c9f528 100644
--- a/CLI/ruby/lib/game_of_life/version.rb
+++ b/CLI/ruby/lib/game_of_life/version.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: true
module GameOfLife
+ # Game of life version number
VERSION = "0.1.2"
end