Skip to content

factory created#1

Open
JohnnyGsy wants to merge 2 commits into
masterfrom
develop
Open

factory created#1
JohnnyGsy wants to merge 2 commits into
masterfrom
develop

Conversation

@JohnnyGsy

Copy link
Copy Markdown
Owner

No description provided.

Comment thread lib/factory.rb Outdated
# - ==, eql?
class Factory
include Enumerable
def self.new(*key_args, keyword_init: false, &block)

@Bulatkin Bulatkin Oct 18, 2021

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  1. please use intentations between methods - it's almost non-readable
  2. What does those lines in Gemfile mean? It causes error.
MyClass = Stuct.new do
  def my_method
    'Method call'
  end
  1. Please add rubocop to Gemfile
  2. Why do we need Enumerable module here?

Comment thread spec/factory_spec.rb Outdated

joe['name'] = 'Luke'
joe[:zip] = '90210'
joe[:zip] = '90210'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

expected: "Luke"
            got: "Joe Smith"
     
       (compared using ==)

Comment thread lib/factory.rb Outdated
Comment on lines +30 to +36
subclass = Class.new(self) do
class << self
define_method :new do |*args|
instance = allocate
instance.send(:initialize, *args)
instance
end

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What are we doing here?

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.

2 participants