-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zad4 #124
base: master
Are you sure you want to change the base?
Zad4 #124
Conversation
def type | ||
'no weapon' | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Null Object dla wojowników bez broni
def self.exp_desc(relation: Mercenary) | ||
relation.order(experience: :desc) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query dla najemników dla poprawienia przejrzystości kodu
|
||
attributes :name, :price, :experience, :available_from, | ||
:preferred_weapon_kind | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obowiązkowy serializer dla najemników
clan: clan, | ||
building: building, | ||
mercenary: @mercenary).call | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service Objects dla poprawienia przejrzystości kodu
Bardzo dobrze rozwiązana praca domowa. Jedyne czego mi tutaj zabrakło to:
|
# frozen_string_literal: true | ||
|
||
class WarriorCreator | ||
def initialize(relation: Warrior, mercenary:, building:, clan:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oczekujemy że WarriorCreator stworzy nam obiekt wojownika więc przekazywanie do niego Klasy z której ma tworzyć jest zbędne.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Racja, poprawione :)
No description provided.