Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Zad4 #124

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Apr 15, 2019

No description provided.

def type
'no weapon'
end
end
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@h4nky
Copy link
Collaborator

h4nky commented Apr 16, 2019

Bardzo dobrze rozwiązana praca domowa. Jedyne czego mi tutaj zabrakło to:

  1. użycie attr_reader w serwisach
  2. ujednolicenie zwrotek w MercenaryController tak aby zwracały Mercanary.
    I dodatkowo można było troszeczkę rozwinąć te funkcjonalności wyboru Klanu i klasy dla naszego najemnika.
    👍

# frozen_string_literal: true

class WarriorCreator
def initialize(relation: Warrior, mercenary:, building:, clan:)
Copy link
Collaborator

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.

Copy link
Author

Choose a reason for hiding this comment

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

Racja, poprawione :)

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

Successfully merging this pull request may close these issues.

2 participants