-
Notifications
You must be signed in to change notification settings - Fork 43
2264-3 #293
base: master
Are you sure you want to change the base?
2264-3 #293
Conversation
attr_reader :uri, :documents, :request | ||
|
||
def initialize(texts) | ||
@uri = URI(URL + PATH) |
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.
@uri - should be constant
|
||
def initialize(texts) | ||
@uri = URI(URL + PATH) | ||
build_documents(texts) |
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.
I should not probably do anything in initializer except for saving input
def initialize(texts)
@texts = texts
end
PATH = '/text/analytics/v2.0/sentiment'.freeze | ||
KEY = 'de8a560ccae541e08ec1a30dcdd191a4'.freeze | ||
|
||
attr_reader :uri, :documents, :request |
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.
should the class count raiting?
attr_reader should define visible for outside incoming and outgoing params:
I assume it should be texts and ratings
the rest is implementation details - it should be in private section (methods in private sections)
end | ||
|
||
def launch_parser | ||
parse_comments_from_page |
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.
method should call at least 2 other methods - otherwise U should remove it:
U can just put the body 'parse_comments_from_page' right here
|
||
def initialize(post) | ||
@post = post | ||
@text_body = launch_comments_parser |
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.
def text_body
@text_body ||= launch_comments_parser
end
seems that text_body doesn't belong to initializer
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.
the same about @rating
Номер
2264
Номер задания
3
Ссылка на видео с демо
https://youtu.be/Uo4Cg1FEdXc
Комментарии
являюсь сторонником минимализма в плане внешнего вида приложения)