Skip to content

Pr-10#11

Open
CheezItMan wants to merge 2 commits intomasterfrom
Pr-10
Open

Pr-10#11
CheezItMan wants to merge 2 commits intomasterfrom
Pr-10

Conversation

@CheezItMan
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@ranuseh ranuseh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall all good.

Comment thread roman.rb
end

def to_roman
n = self
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More descriptive variable names

Comment thread roman_test.rb
require 'minitest/autorun'
require_relative 'roman_numerals'

# Common test data version: 1.0.0 070e8d5
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add edge cases?

@paulentine
Copy link
Copy Markdown

I like how you committed your tests before committing your code. Red-green-refactor!

Comment thread roman.rb
end

def to_roman
n = self
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would benefit to leave comment that n is an instance of Fixnum, which gets converted to roman via to_roman

Comment thread roman.rb
@@ -0,0 +1,30 @@
class Fixnum

def roman
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this is in a method?

Comment thread roman.rb
Comment thread roman.rb
result = ""
roman.each do |num, letter|
result << letter * (n / num)
n = n % num
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be slightly shortened with n %= num

Comment thread roman_test.rb
end

def test_2
skip
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be skipping these tests? We probably want to comment these out.

Comment thread roman.rb
@@ -0,0 +1,30 @@
class Fixnum

def roman
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we think about making this an instance variable vs. a function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants