Skip to content

Commit 0671f98

Browse files
committed
Improve inline documentation
1 parent c73cf66 commit 0671f98

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/egn/egn.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module Egn
33
class Egn
44
attr_reader :number, :birth_date
55

6-
# Creates a new EGN object. Has different effects depending on the argument.
7-
# When no arguments are given, it generates a new random EGN
8-
# When a String is given, it is assumed that it is an EGN and is parsed
9-
# When a hash is given, a new EGN is generated with the provided options
6+
# Creates a new EGN object. Has different effects depending on the arguments:
7+
# when no arguments are given, it generates a new random EGN;
8+
# when a String is given, it is parsed as an EGN;
9+
# when a hash is given, a new EGN is generated with the provided options.
1010
def initialize(args=nil)
1111

1212
if args.nil?

lib/egn/generator.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Egn
33
class Generator
44
attr_reader :options
55

6-
# Convinience method
6+
# Convenience method
77
def self.generate(options={})
88
Generator.new(options).generate
99
end
@@ -14,7 +14,7 @@ def initialize(options={})
1414
process!
1515
end
1616

17-
# The generated EGN will be completely random if no opitons are given.
17+
# The generated EGN will be completely random if no options are given.
1818
# options is a hash that may have the following keys: :year, :month, :day, :gender
1919
def generate
2020
egn = format(options[:year]) +
@@ -36,7 +36,7 @@ def set_defaults!(options)
3636

3737
end
3838

39-
# Little helper
39+
# Little helper that prefixes strings with 0s
4040
def format(val, pre=2)
4141
val.to_s.rjust(pre, '0')
4242
end

0 commit comments

Comments
 (0)