@mahmoudgharib/umd_flightticket_module 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/module.cjs +44 -0
  2. package/package.json +12 -0
package/module.cjs ADDED
@@ -0,0 +1,44 @@
1
+ (function(definition, env){
2
+ if(typeof module !== "undefined" && module.exports){
3
+ module.exports = definition()
4
+ }
5
+ else if(typeof window !== "undefined"){
6
+ window.myModule = definition();
7
+ }
8
+ })(function(){
9
+ class Flight{
10
+ constructor(seat, flight, departure, arrivalAirport, travelingDate){
11
+ this.seat = seat;
12
+ this.fight = flight;
13
+ this.departure = departure;
14
+ this.arrivalAirport = arrivalAirport;
15
+ this.travelingDate = travelingDate;
16
+ }
17
+
18
+ get flightInfo(){
19
+ return `Boarding Pass: Flight: ${this.fight}, Seat: ${this.seat}, Departure: ${this.departure}, Traveling Date: ${this.travelingDate}, Airport: ${this.arrivalAirport}`
20
+ }
21
+
22
+ updateData(seat, flight, departure, arrivalAirport, travelingDate){
23
+ this.seat = seat;
24
+ this.fight = flight;
25
+ this.departure = departure;
26
+ this.arrivalAirport = arrivalAirport;
27
+ this.travelingDate = travelingDate;
28
+ return "Ticket data has been updated successfully."
29
+ }
30
+
31
+ displayInfo(){
32
+ console.log("Your Boarding Pass:")
33
+ console.log(`Flight: ${this.fight}`)
34
+ console.log(`Seat: ${this.seat}`)
35
+ console.log(`Departure: ${this.departure}`)
36
+ console.log(`Traveling Date: ${this.travelingDate}`)
37
+ console.log(`Airport: ${this.arrivalAirport}`)
38
+ return "Data Has been Displayed!"
39
+ }
40
+ }
41
+
42
+ return new Flight();
43
+ }, this);
44
+
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@mahmoudgharib/umd_flightticket_module",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
12
+ }