Angelo Sinatra Project

Hello my name is Angelo Milien and today I am happy to present my sinatra project witch is a web application called the Bakery App. this presentation is basically an overview about how the application works but first of all I want to thank God and then Flatiron School to give me the opportunity to be part of something great and my goal is to not disappoint none of them. the bakery app is made for any bakery management office but for our case and project requirements we selected one of the biggest bakery on long island named Lakewood Bakery .

when a new customer(called stop most of the times) call the the office to place an order the employee user taking that call need a way to register that new stop or customer and as a big company having multiple routes (cities where Lakewood trucks do deliveries) depending on the location of that new stop we assign to it a specific route number witch can be route 1 or route 8 or etc.. .

So user must sign up first and then sign in to be able to see the stops add a stops edit a specific stop or delete a chosen stop. So in the link below I will leave a video so that if one picture is worth one thousand word imagine the worth of a video!!. On that before I concluding my presentation I would like to talk about two features (! the bang and, ||= the or equal )on ruby that somehow its a little difficult for beginners to get along with even after we learn them already, every time we come across with them we feel we have to learn them again and again and the point is after this explanation no one will never have to learn this anymore.

there is something all ruby developers must know witch is, in ruby all data have truthy and falsy value but there are only two piece of data that actually have falsy value they are “false” and “nil” after that anything else has truthy value.

the bang work like the logic “not” it inverse truthy value of data, is usually put after methods (array.each!) to modifies their return value but this is not covered here, we are going to focus instead in when is put before the data like this “!data” or “!!data” where it can be one , two or any number of bang but on ruby we only use until two as other amount would be a repeated action of the one if it s’ an odd number of bang and the two if it’s an even number of bang.

each bang added reverse the previous truthy or falsy value of the data.


with truthy value data 
2.6.1 :010 > v = "any string"=> "any string"2.6.1 :011 > !v=> false2.6.1 :012 > !!v=> true2.6.1 :013 > !!!v=> false2.6.1 :014 > !!!!v=> true2.6.1 :015 >try it out with integer also or any data you want
with falsy value data nil
2.6.1 :015 > nil=> nil2.6.1 :016 > !nil=> true2.6.1 :017 > !!nil=> falsewith false2.6.1 :018 > false=> false2.6.1 :019 > !false=> true2.6.1 :020 > !!false=> false2.6.1 :021 >

that was easy right? now let’s see the or equal “||= ” we usually see it expressed like that “ a || = b ” ; now this expression has two variable “a” and “b” but it always return “a” it will return “a” with the value inside of it if that value is not nil or false otherwise it will return “a” with the value inside of “b” but remember it will always return a, let’s see an example.

2.6.1 :021 > a = 1=> 12.6.1 :022 > b = nil=> nil2.6.1 :023 > a||= b=> 12.6.1 :024 > a = false=> false2.6.1 :025 > a||= b=> nil2.6.1 :026 >

now you see it couldn’t be easier right !! you welcome now I want to say thank you for letting me be part of this and we will meet again thank you!!.

checkout my video and my code on github on the links below



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store