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

web api #26

Merged
merged 29 commits into from Mar 12, 2019
Merged

web api #26

merged 29 commits into from Mar 12, 2019

Conversation

yummta
Copy link
Contributor

@yummta yummta commented Mar 10, 2019

Team Valeria, Paul y Christopher

"url": "https://swapi.co/api/people/10/"
}
]
}
Copy link
Contributor

@Linzeur Linzeur Mar 11, 2019

Choose a reason for hiding this comment

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

I think It's a good idea to store the data of api in files to use them as backup. Good Job!

Copy link
Contributor

Choose a reason for hiding this comment

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

you're right. we let it slip. thanks for making us notice it :)

- Mejorar interfaz
- Switch using api and local storage
- Validaciones rspec
- Validar que son varias páginas
Copy link
Contributor

Choose a reason for hiding this comment

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

I like your list of pending tasks. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Visual Studio Code has many plugins that identify the TODO tag. This can be very helpful to coordinate group work.

" 1. Most expensive vehicles",
" 2. Fastest vehicles",
" 3. Tallest people",
" 4. Heaviest people",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you tell me how this information about overweight people could be significant to us?

Copy link
Contributor

Choose a reason for hiding this comment

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

It was just a fact, we didn't really had any other in mind. You're right. We'll probably change it if we release another version of this :) thanks for noticing it.

end

def parse_values_to_i(arr_bidimensional)
arr_bidimensional.map! do |i|
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you use map! instead of map ?

Copy link
Contributor

Choose a reason for hiding this comment

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

oh, you're right! we just realized it wasn't necessary 😅

@KattyaCuevas
Copy link
Contributor

Missing specs


def get_results(json_complete)
json_complete[RELEVANT_DATA]
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Organize your code is very good, but I think it is unnecesary create a method for only 1 line of code, it would be more readable if the line 47 use directly in the places where you use the method.

def fetch_data(query)
@http = HTTP.get(BASE_URL + query + "/")
JSON.parse(@http)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Be careful! Revise good the api that you use, because it sometimes come divide for pages, in this case if you revise the link https://swapi.co/api/people/, in the key "Next" appear a value that show you the rest of information is in page 2.

"url": "https://swapi.co/api/vehicles/24/"
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Good Job! looks very organized :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks 😃

}
top
end

Copy link
Contributor

Choose a reason for hiding this comment

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

The method "times" seems to me very interesting to use, but it would be more simple and short if your information store in a array so if you want get only a specify amount you would just need to use the index final to return the information.

@printable_data = []
end

def give_me_the_top

Choose a reason for hiding this comment

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

How can this method be renamed to be more clear? What does it build?

json_complete[RELEVANT_DATA]
end

def get_main_attribute(result, main_attribute)

Choose a reason for hiding this comment

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

I prefer methods that aren't named with the get_ prefix, it looks cleaner 😄

results = get_results(json_answer)
main_attributes = get_main_attribute(results, @name_main_attr)
top_ordered = get_top_of_results(main_attributes, results)
final_top = build_final_top(@relevant_keys, top_ordered)
Copy link
Contributor

Choose a reason for hiding this comment

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

@printable_data = ...

@@ -0,0 +1,21 @@
### Use instructions

```bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be shell instead of bash. Bash is one of the available system shells and we are using zsh.

- Mejorar interfaz
- Switch using api and local storage
- Validaciones rspec
- Validar que son varias páginas
Copy link
Contributor

Choose a reason for hiding this comment

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

Program accomplishes what's required, but I would appreciate if the a small description of the parts is available.

@tops = tops
end

def run
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the system class include the main procedure to execute the program?

require "csv"

class System
TEXT_INSTRUCTIONS = [
Copy link
Contributor

Choose a reason for hiding this comment

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

To reuse the class, this array can be an outside input.

def run
print_instructions
chosen_number = get_chosen_number
system "clear"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget that this command is *nix only. Won't work in Windows machines.

end

def get_chosen_number
numero_top = gets.to_i
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't work if input is different from the menu's range.

@KattyaCuevas KattyaCuevas merged commit e7c402c into ableco:master Mar 12, 2019
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.

None yet

8 participants