flightcheck 0.0.4 → 0.0.5

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 (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/flightcheck.rb +18 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05660373fa394a9d0fd55d8870becb5f5be6433f
4
- data.tar.gz: c913d72bdb85376fe98a85c85b01712bbf17cd10
3
+ metadata.gz: 5648fb618f9441ef33e3a1bff16d418cdb8d61c3
4
+ data.tar.gz: d2d069e30c372f2388a8ba2f4782e9ae43b2422a
5
5
  SHA512:
6
- metadata.gz: b7d21c9f1dd5c1fa3df1e44328e0596d08e6d8d99ca6e8bc881d0e301eccf74b8a752dc37fa56984be26279a800e0ce35fab512177d917e38de8408c52bef14b
7
- data.tar.gz: 05d83b6cde933d34c7d88a451d2dc826a653433803b0cbb868f7c625dd77b53a3dc880be08b982a06a06091cfc561a87ee9612359a0ae3db8b952ea4ee96b6fd
6
+ metadata.gz: 20a9c2c0da573f964270277e37b3c07638b2c6f1009bbb4369bf03562854bde50fa3ff4d8bfb63bd0a1f4b793d4bfe448ff5b7130933780048449b76d9a2ad85
7
+ data.tar.gz: 918596fe39ffc9d7e6c9e6e686aae35b85f192fadab1da47147c19726b93cab934cb3b32cf9bb3e384ce3e4df2350af1359b490952f5b8dbbee97c1198ee9397
data/lib/flightcheck.rb CHANGED
@@ -1,12 +1,15 @@
1
1
  require 'mechanize'
2
2
 
3
3
  class Flight
4
- attr_reader :flightNumber, :departureDate, :title, :status, :url
4
+ attr_reader :flightNumber, :departureDate, :title, :status, :url, :raw_airline_iata, :airline_iata, :departure_airport, :arrival_airport
5
5
 
6
6
  def initialize(flightNumber, departureDate)
7
7
  @flightNumber = flightNumber
8
8
  @departureDate = departureDate
9
9
  @url = "http://www.flightstats.com/go/FlightStatus/flightStatusByFlight.do?airline=&flightNumber=#{flightNumber}&departureDate=#{departureDate}"
10
+ @airline_iata = nil
11
+ @departure_airport = nil
12
+ @arrival_airport = nil
10
13
  end
11
14
 
12
15
  def check
@@ -18,5 +21,19 @@ class Flight
18
21
 
19
22
  puts @title
20
23
  puts @status
24
+
25
+ ## Airline IATA
26
+ # Extract raw airline iata and convert to string to avoid
27
+ # TypeError: no implicit conversion of MatchData intro String
28
+ @raw_airline_iata = /\(\w+\)/.match(@title).to_s
29
+
30
+ # Extract the airline IATA without the paraentheses
31
+ @airline_iata = /\w+/.match(@raw_airline_iata)
32
+
33
+ ## Departure airport IATA
34
+ # Code here
35
+
36
+ ## Arrival airport IATA
37
+ # Code here
21
38
  end
22
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flightcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Narek Aramjan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2014-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize