flyline 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 678c0bf79ede534d67ce309c1f902b60d94ea758770a4616e75a7a0c4343d486
4
+ data.tar.gz: 12884b3aa866db826ed5a5dca5d98a9bd33b6b1c72ce3a199b0076261fb0abe6
5
+ SHA512:
6
+ metadata.gz: d550ac6eba5f7401bb27dd2886b6738ca3a77152b52f390c693d8f6b4d2534d0eeb78361c2fa1bf715df85907baadd2296c812799738d549565b77495757b4ef
7
+ data.tar.gz: 034736d2cbb717f28cb6cdf6bd5379d1f8c709b86179514a3963fe7640937da3614289991bacf332cd5339be11eb31afa1859fb9b241b0a20d82a8d23cd79bfb
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2021-06-16
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at 60868470+dev-caf@users.noreply.github.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in flyline.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rubocop", "~> 1.7"
data/Gemfile.lock ADDED
@@ -0,0 +1,40 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ flyline (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ parallel (1.20.1)
11
+ parser (3.0.1.1)
12
+ ast (~> 2.4.1)
13
+ rainbow (3.0.0)
14
+ rake (13.0.3)
15
+ regexp_parser (2.1.1)
16
+ rexml (3.1.9)
17
+ rubocop (1.17.0)
18
+ parallel (~> 1.10)
19
+ parser (>= 3.0.0.0)
20
+ rainbow (>= 2.2.2, < 4.0)
21
+ regexp_parser (>= 1.8, < 3.0)
22
+ rexml
23
+ rubocop-ast (>= 1.7.0, < 2.0)
24
+ ruby-progressbar (~> 1.7)
25
+ unicode-display_width (>= 1.4.0, < 3.0)
26
+ rubocop-ast (1.7.0)
27
+ parser (>= 3.0.1.1)
28
+ ruby-progressbar (1.11.0)
29
+ unicode-display_width (2.0.0)
30
+
31
+ PLATFORMS
32
+ ruby
33
+
34
+ DEPENDENCIES
35
+ flyline!
36
+ rake (~> 13.0)
37
+ rubocop (~> 1.7)
38
+
39
+ BUNDLED WITH
40
+ 1.17.2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 devcaf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # Flyline
2
+
3
+ Client library for [Flyline API](https://flyline.io/docs/). Supports all endpoints, as well as travelling API requests
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'flyline'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install flyline
20
+
21
+ ## Usage
22
+
23
+ First of all, initialize client:
24
+
25
+ ```ruby
26
+ client = Flyline::Client.new("FToken")
27
+ ```
28
+
29
+
30
+
31
+ And then send Request according to your Request:
32
+
33
+ ```ruby
34
+ client.get_seatTypes()
35
+ ```
36
+
37
+ ## Development
38
+
39
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
40
+
41
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
42
+
43
+ ## Contributing
44
+
45
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Flyline-Development/flyline_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Flyline-Development/flyline_ruby/blob/master/CODE_OF_CONDUCT.md).
46
+
47
+ ## License
48
+
49
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
50
+
51
+ ## Code of Conduct
52
+
53
+ Everyone interacting in the Flyline project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Flyline-Development/flyline_ruby/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rubocop/rake_task"
5
+
6
+ RuboCop::RakeTask.new
7
+
8
+ task default: :rubocop
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "flyline"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/flyline.gemspec ADDED
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/flyline/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "flyline"
7
+ spec.version = Flyline::VERSION
8
+ spec.authors = ["flyline"]
9
+ spec.email = ["development@flyline.io"]
10
+
11
+ spec.summary = "Travel Tech Simplified & Modernized"
12
+ spec.description = "We provide a modern and simple product suite to access rich content, real-time pricing, flight availability, and much more from all major airlines."
13
+ spec.homepage = "https://staging.flyline.io"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
16
+
17
+
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/Flyline-Development/flyline_ruby.git"
21
+ spec.metadata["changelog_uri"] = "https://github.com/FlyLine-Development/flyline_ruby/issues"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ # Uncomment to register a new dependency of your gem
33
+ # spec.add_dependency "example-gem", "~> 1.0"
34
+
35
+ # For more information and examples about making a new gem, checkout our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ end
data/lib/flyline.rb ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "flyline/version"
4
+ require_relative "flyline/client"
5
+ module Flyline
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ end
@@ -0,0 +1,120 @@
1
+ require("httparty")
2
+ require "json"
3
+ require "net/http"
4
+ ./lib/flyline/client.rb
5
+ module Flyline
6
+ class Client
7
+ include HTTParty
8
+ include JSON
9
+ base_url "https://api.flyline.io"
10
+ format :json
11
+ def initialize(f_token)
12
+ self.class.default_option_merge!(headers: {'Authorization'=> "FToken #{f_token}", 'Content-Type' => "application/json"})
13
+ end
14
+
15
+ def sendPostRequest(endPoint, data)
16
+ self.class.post(endPoint, JSON.dump(data)).parsed_response
17
+ end
18
+
19
+ def sendGetRequest(endPoint)
20
+ self.class.get(endPoint).parsed_response
21
+ end
22
+
23
+ def get_airfares(data)
24
+ self.sendPostRequest("/api/flights/shop/", data)
25
+ end
26
+
27
+ def get_airattributesByFlightNumber(data)
28
+ self.sendPostRequest("/api/search/amenities/", data)
29
+ end
30
+
31
+ def get_airattributesByRoute(data)
32
+ self.sendPostRequest("/api/amenities/search/route", data)
33
+ end
34
+
35
+ def get_schedulesByFlightNumber(data)
36
+ self.sendPostRequest("/api/schedule-flight", data)
37
+ end
38
+
39
+ def get_schedulesByRoute(data)
40
+ self.sendPostRequest("/api/schedule/", data)
41
+ end
42
+
43
+ def get_seatMaps(data)
44
+ self.sendPostRequest("/api/seat-maps", data)
45
+ end
46
+
47
+ def get_aircrafts()
48
+ self.sendGetRequest("/api/aircraft/")
49
+ end
50
+
51
+ def get_aircraft(iata_code)
52
+ self.sendGetRequest("/api/aircraft/" + iata_code + "/")
53
+ end
54
+
55
+ def get_airlines()
56
+ self.sendGetRequest("/api/airlines/")
57
+ end
58
+
59
+ def get_airline(iata_code)
60
+ self.sendGetRequest("/api/airlines/" + iata_code + "/")
61
+ end
62
+
63
+ def get_airports()
64
+ self.sendGetRequest("/api/airports/")
65
+ end
66
+
67
+ def get_airport(iata_code)
68
+ self.sendGetRequest("/api/airports/" + iata_code + "/")
69
+ end
70
+
71
+ def get_airportByCity(iata_code)
72
+ self.sendGetRequest("/api/cities/" + iata_code + "/airports/")
73
+ end
74
+
75
+ def get_cities()
76
+ self.sendGetRequest("/api/cities")
77
+ end
78
+
79
+ def get_city(iata_code)
80
+ self.sendGetRequest("/api/cities/" + iata_code + "/")
81
+ end
82
+
83
+ def get_cabinClassMapping(carrier, cabin_class)
84
+ if carrier != "" && cabin_class != ""
85
+ self.sendGetRequest("/api/cabin-booking?carrier=" + carrier + "&cabin_class" + cabin_class)
86
+ else
87
+ self.sendGetRequest("/api/cabin-booking/")
88
+ end
89
+ end
90
+
91
+
92
+ def get_seatTypes()
93
+ self.sendGetRequest("/api/seats/")
94
+ end
95
+
96
+ def get_aeatLayouts()
97
+ self.sendGetRequest("/api/layouts/")
98
+ end
99
+
100
+ def get_aoods()
101
+ self.sendGetRequest("/api/foods/")
102
+ end
103
+
104
+ def get_aeverages()
105
+ self.sendGetRequest("/api/beverages/")
106
+ end
107
+
108
+ def get_antertainments()
109
+ self.sendGetRequest("/api/entertainments/")
110
+ end
111
+
112
+ def get_aifis()
113
+ self.sendGetRequest("/api/wifis/")
114
+ end
115
+
116
+ def get_aowers()
117
+ self.sendGetRequest("/api/powers")
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Flyline
4
+ VERSION = "0.1.0"
5
+ end
Binary file
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flyline
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - flyline
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-06-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: We provide a modern and simple product suite to access rich content,
14
+ real-time pricing, flight availability, and much more from all major airlines.
15
+ email:
16
+ - development@flyline.io
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - CHANGELOG.md
22
+ - CODE_OF_CONDUCT.md
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - bin/console
29
+ - bin/setup
30
+ - flyline.gemspec
31
+ - lib/flyline.rb
32
+ - lib/flyline/client.rb
33
+ - lib/flyline/version.rb
34
+ - pkg/flyline-0.1.0.gem
35
+ homepage: https://staging.flyline.io
36
+ licenses:
37
+ - MIT
38
+ metadata:
39
+ homepage_uri: https://staging.flyline.io
40
+ source_code_uri: https://github.com/Flyline-Development/flyline_ruby.git
41
+ changelog_uri: https://github.com/FlyLine-Development/flyline_ruby/issues
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.4.0
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubygems_version: 3.0.3
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Travel Tech Simplified & Modernized
61
+ test_files: []