Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

2264-3 #293

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

2264-3 #293

wants to merge 6 commits into from

Conversation

mrsdev66
Copy link
Contributor

Номер

2264

Номер задания

3

Ссылка на видео с демо

https://youtu.be/Uo4Cg1FEdXc

Комментарии

являюсь сторонником минимализма в плане внешнего вида приложения)

@mrsdev66 mrsdev66 changed the title Task3 2264-3 Jul 27, 2018
attr_reader :uri, :documents, :request

def initialize(texts)
@uri = URI(URL + PATH)
Copy link

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

@kislak kislak Aug 8, 2018

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

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

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

@kislak kislak Aug 8, 2018

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

Copy link

@kislak kislak Aug 8, 2018

Choose a reason for hiding this comment

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

the same about @rating

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

Successfully merging this pull request may close these issues.

2 participants