tmsapi 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +86 -0
- data/.project +17 -0
- data/.rspec +2 -0
- data/.travis.yml +11 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +94 -0
- data/Rakefile +14 -0
- data/Readme.md +62 -0
- data/lib/tmsapi/api.rb +61 -0
- data/lib/tmsapi/middleware/custom_logger.rb +70 -0
- data/lib/tmsapi/model/airing.rb +24 -0
- data/lib/tmsapi/model/award.rb +14 -0
- data/lib/tmsapi/model/base.rb +9 -0
- data/lib/tmsapi/model/caption.rb +8 -0
- data/lib/tmsapi/model/episode.rb +11 -0
- data/lib/tmsapi/model/event.rb +10 -0
- data/lib/tmsapi/model/image.rb +16 -0
- data/lib/tmsapi/model/lineup.rb +12 -0
- data/lib/tmsapi/model/movie.rb +16 -0
- data/lib/tmsapi/model/person.rb +12 -0
- data/lib/tmsapi/model/program.rb +36 -0
- data/lib/tmsapi/model/quality_rating.rb +8 -0
- data/lib/tmsapi/model/rating.rb +8 -0
- data/lib/tmsapi/model/recommendation.rb +9 -0
- data/lib/tmsapi/model/showtime.rb +13 -0
- data/lib/tmsapi/model/sport_event.rb +11 -0
- data/lib/tmsapi/model/station.rb +19 -0
- data/lib/tmsapi/model/station_airings.rb +14 -0
- data/lib/tmsapi/model/team.rb +9 -0
- data/lib/tmsapi/model/theatre.rb +8 -0
- data/lib/tmsapi/model.rb +26 -0
- data/lib/tmsapi/resource/base.rb +20 -0
- data/lib/tmsapi/resource/lineups.rb +58 -0
- data/lib/tmsapi/resource/movies.rb +21 -0
- data/lib/tmsapi/resource/movies_theatres.rb +37 -0
- data/lib/tmsapi/resource/movies_tv.rb +41 -0
- data/lib/tmsapi/resource/programs.rb +103 -0
- data/lib/tmsapi/resource/series.rb +45 -0
- data/lib/tmsapi/resource/sports.rb +35 -0
- data/lib/tmsapi/resource/stations.rb +47 -0
- data/lib/tmsapi/resource.rb +13 -0
- data/lib/tmsapi/version.rb +3 -0
- data/lib/tmsapi.rb +10 -0
- data/spec/api_spec.rb +354 -0
- data/spec/factories.rb +56 -0
- data/spec/model/program_spec.rb +33 -0
- data/spec/spec_helper.rb +45 -0
- data/spec/support/vcr.rb +20 -0
- data/spec/tms_api_spec.rb +7 -0
- data/spec/vcr/cassettes/TMSAPI_API/_lineups/_airings/should_tell_me_whats_airing.yml +37649 -0
- data/spec/vcr/cassettes/TMSAPI_API/_lineups/_channels/should_list_some_channels.yml +2623 -0
- data/spec/vcr/cassettes/TMSAPI_API/_lineups/_details/should_tell_me_about_the_lineup.yml +67 -0
- data/spec/vcr/cassettes/TMSAPI_API/_lineups/_find/should_find_local_lineups.yml +103 -0
- data/spec/vcr/cassettes/TMSAPI_API/_lineups/_stations/should_list_some_channels.yml +2623 -0
- data/spec/vcr/cassettes/TMSAPI_API/_movies/_theatres/_showings/should_get_movie_showings.yml +460 -0
- data/spec/vcr/cassettes/TMSAPI_API/_movies/_tv/_airings/should_tell_me_what_movies_are_on_tv.yml +6722 -0
- data/spec/vcr/cassettes/TMSAPI_API/_movies/_tv/_versions/should_tell_me_about_that_movie.yml +1366 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_advance_planner/should_list_holiday_events.yml +1951 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_airings/should_find_airings.yml +85 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_details/should_be_filled_with_program_information.yml +117 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_genres/should_return_all_genres.yml +131 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_images/should_return_images.yml +225 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_new_past_week/should_have_programs.yml +2238 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_new_shows/should_find_new_shows.yml +1105 -0
- data/spec/vcr/cassettes/TMSAPI_API/_programs/_search/should_find_4_programs.yml +152 -0
- data/spec/vcr/cassettes/TMSAPI_API/_series/_airings/should_list_airings.yml +341 -0
- data/spec/vcr/cassettes/TMSAPI_API/_series/_details/should_find_the_series.yml +272 -0
- data/spec/vcr/cassettes/TMSAPI_API/_series/_episodes/should_return_episodes.yml +3492 -0
- data/spec/vcr/cassettes/TMSAPI_API/_stations/_airings/should_list_airings.yml +123 -0
- data/spec/vcr/cassettes/TMSAPI_API/_stations/_details/should_get_station_details.yml +67 -0
- data/tmsapi.gemspec +42 -0
- metadata +296 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9b01ee59db3a47937a63cea09c17aac262612367
|
4
|
+
data.tar.gz: c1d6f43454a2b9cd2c0dbaef16a35c2412d2d457
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 25e7a6b9514b70c41326871cd990c11218543615d6ee340f18c99ab811b697e6ac637b0e176ae214784c54ba08247f93c57af7a4ad304900a6ad431b89da16a7
|
7
|
+
data.tar.gz: e1b45b87d6c51b2b2263dcea420590a4ef64d310efa4f4b859840103d2481fe966247c9c8e3e5228511aff79241c2526779f810a299e0135cfb9acc7ed746de4
|
data/.gitignore
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Documentation cache and generated files:
|
13
|
+
/.yardoc/
|
14
|
+
/_yardoc/
|
15
|
+
/doc/
|
16
|
+
/rdoc/
|
17
|
+
|
18
|
+
## Environment normalisation:
|
19
|
+
/.bundle/
|
20
|
+
/lib/bundler/man/
|
21
|
+
|
22
|
+
# for a library or gem, you might want to ignore these files since the code is
|
23
|
+
# intended to run in multiple environments; otherwise, check them in:
|
24
|
+
# Gemfile.lock
|
25
|
+
# .ruby-version
|
26
|
+
# .ruby-gemset
|
27
|
+
|
28
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
29
|
+
.rvmrc
|
30
|
+
|
31
|
+
.bundle
|
32
|
+
.config
|
33
|
+
.yardoc
|
34
|
+
Gemfile.lock
|
35
|
+
InstalledFiles
|
36
|
+
_yardoc
|
37
|
+
coverage
|
38
|
+
lib/bundler/man
|
39
|
+
pkg
|
40
|
+
rdoc
|
41
|
+
spec/reports
|
42
|
+
test/tmp
|
43
|
+
test/version_tmp
|
44
|
+
tmp
|
45
|
+
.rbenv-vars
|
46
|
+
.coveralls.yml
|
47
|
+
.ruby-version
|
48
|
+
.ruby-gemset
|
49
|
+
|
50
|
+
# Compiled source #
|
51
|
+
###################
|
52
|
+
*.com
|
53
|
+
*.class
|
54
|
+
*.dll
|
55
|
+
*.exe
|
56
|
+
*.o
|
57
|
+
*.so
|
58
|
+
|
59
|
+
# Packages #
|
60
|
+
############
|
61
|
+
# it's better to unpack these files and commit the raw source
|
62
|
+
# git has its own built in compression methods
|
63
|
+
*.7z
|
64
|
+
*.dmg
|
65
|
+
*.gz
|
66
|
+
*.iso
|
67
|
+
*.jar
|
68
|
+
*.rar
|
69
|
+
*.tar
|
70
|
+
*.zip
|
71
|
+
|
72
|
+
# Logs and databases #
|
73
|
+
######################
|
74
|
+
*.log
|
75
|
+
*.sql
|
76
|
+
*.sqlite
|
77
|
+
|
78
|
+
# OS generated files #
|
79
|
+
######################
|
80
|
+
.DS_Store
|
81
|
+
.DS_Store?
|
82
|
+
._*
|
83
|
+
.Spotlight-V100
|
84
|
+
.Trashes
|
85
|
+
ehthumbs.db
|
86
|
+
Thumbs.db
|
data/.project
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<projectDescription>
|
3
|
+
<name>tmsapi</name>
|
4
|
+
<comment></comment>
|
5
|
+
<projects>
|
6
|
+
</projects>
|
7
|
+
<buildSpec>
|
8
|
+
<buildCommand>
|
9
|
+
<name>com.aptana.ide.core.unifiedBuilder</name>
|
10
|
+
<arguments>
|
11
|
+
</arguments>
|
12
|
+
</buildCommand>
|
13
|
+
</buildSpec>
|
14
|
+
<natures>
|
15
|
+
<nature>com.aptana.ruby.core.rubynature</nature>
|
16
|
+
</natures>
|
17
|
+
</projectDescription>
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
tmsapi (0.0.1)
|
5
|
+
faraday (~> 0.8.7)
|
6
|
+
faraday_middleware (~> 0.9.0)
|
7
|
+
json (~> 1.8.1)
|
8
|
+
rash (~> 0.4.0)
|
9
|
+
virtus (~> 1.0.1)
|
10
|
+
|
11
|
+
GEM
|
12
|
+
remote: https://rubygems.org/
|
13
|
+
specs:
|
14
|
+
activesupport (4.0.2)
|
15
|
+
i18n (~> 0.6, >= 0.6.4)
|
16
|
+
minitest (~> 4.2)
|
17
|
+
multi_json (~> 1.3)
|
18
|
+
thread_safe (~> 0.1)
|
19
|
+
tzinfo (~> 0.3.37)
|
20
|
+
atomic (1.1.14)
|
21
|
+
axiom-types (0.0.5)
|
22
|
+
descendants_tracker (~> 0.0.1)
|
23
|
+
ice_nine (~> 0.9)
|
24
|
+
coercible (1.0.0)
|
25
|
+
descendants_tracker (~> 0.0.1)
|
26
|
+
coveralls (0.7.0)
|
27
|
+
multi_json (~> 1.3)
|
28
|
+
rest-client
|
29
|
+
simplecov (>= 0.7)
|
30
|
+
term-ansicolor
|
31
|
+
thor
|
32
|
+
descendants_tracker (0.0.3)
|
33
|
+
diff-lcs (1.2.5)
|
34
|
+
docile (1.1.1)
|
35
|
+
equalizer (0.0.8)
|
36
|
+
factory_girl (4.3.0)
|
37
|
+
activesupport (>= 3.0.0)
|
38
|
+
fakeweb (1.3.0)
|
39
|
+
faraday (0.8.8)
|
40
|
+
multipart-post (~> 1.2.0)
|
41
|
+
faraday_middleware (0.9.0)
|
42
|
+
faraday (>= 0.7.4, < 0.9)
|
43
|
+
hashie (2.0.5)
|
44
|
+
i18n (0.6.9)
|
45
|
+
ice_nine (0.11.0)
|
46
|
+
json (1.8.1)
|
47
|
+
mime-types (2.0)
|
48
|
+
minitest (4.3.2)
|
49
|
+
multi_json (1.8.2)
|
50
|
+
multipart-post (1.2.0)
|
51
|
+
rake (10.1.0)
|
52
|
+
rash (0.4.0)
|
53
|
+
hashie (~> 2.0.0)
|
54
|
+
rest-client (1.6.7)
|
55
|
+
mime-types (>= 1.16)
|
56
|
+
rspec (2.14.1)
|
57
|
+
rspec-core (~> 2.14.0)
|
58
|
+
rspec-expectations (~> 2.14.0)
|
59
|
+
rspec-mocks (~> 2.14.0)
|
60
|
+
rspec-core (2.14.7)
|
61
|
+
rspec-expectations (2.14.4)
|
62
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
63
|
+
rspec-mocks (2.14.4)
|
64
|
+
simplecov (0.8.2)
|
65
|
+
docile (~> 1.1.0)
|
66
|
+
multi_json
|
67
|
+
simplecov-html (~> 0.8.0)
|
68
|
+
simplecov-html (0.8.0)
|
69
|
+
term-ansicolor (1.2.2)
|
70
|
+
tins (~> 0.8)
|
71
|
+
thor (0.18.1)
|
72
|
+
thread_safe (0.1.3)
|
73
|
+
atomic
|
74
|
+
tins (0.13.1)
|
75
|
+
tzinfo (0.3.38)
|
76
|
+
vcr (2.8.0)
|
77
|
+
virtus (1.0.1)
|
78
|
+
axiom-types (~> 0.0.5)
|
79
|
+
coercible (~> 1.0)
|
80
|
+
descendants_tracker (~> 0.0.1)
|
81
|
+
equalizer (~> 0.0.7)
|
82
|
+
|
83
|
+
PLATFORMS
|
84
|
+
ruby
|
85
|
+
x86-mingw32
|
86
|
+
|
87
|
+
DEPENDENCIES
|
88
|
+
coveralls (~> 0.7.0)
|
89
|
+
factory_girl (~> 4.0)
|
90
|
+
fakeweb (~> 1.3.0)
|
91
|
+
rake (~> 10.1.0)
|
92
|
+
rspec (~> 2.0)
|
93
|
+
tmsapi!
|
94
|
+
vcr (~> 2.4)
|
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
4
|
+
Bundler.setup
|
5
|
+
Bundler::GemHelper.install_tasks
|
6
|
+
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
desc 'Run RSpec'
|
9
|
+
RSpec::Core::RakeTask.new do |spec|
|
10
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
11
|
+
spec.rspec_opts = ['--color', '--format nested']
|
12
|
+
end
|
13
|
+
|
14
|
+
task :default => :spec
|
data/Readme.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# TMS API
|
2
|
+
|
3
|
+
[![Build Status](https://travis-ci.org/JDiPierro/tmsapi.png?branch=master)](https://travis-ci.org/JDiPierro/tmsapi)
|
4
|
+
[![Coverage Status](https://coveralls.io/repos/JDiPierro/tmsapi/badge.png?branch=master)](https://coveralls.io/r/JDiPierro/tmsapi?branch=master)
|
5
|
+
[![Dependency Status](https://gemnasium.com/JDiPierro/tmsapi.png)](https://gemnasium.com/JDiPierro/tmsapi)
|
6
|
+
|
7
|
+
A Ruby wrapper around connecting to the [TMS API](https://developer.tmsapi.com)
|
8
|
+
|
9
|
+
This is my first project in Ruby so I'm using [petems/riot_api](https://github.com/petems/riot_api/) as a template.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Not yet published to Rubygems
|
14
|
+
|
15
|
+
## Usage:
|
16
|
+
|
17
|
+
You'll need to get an API key from [http://developer.tmsapi.com/](http://developer.tmsapi.com/).
|
18
|
+
|
19
|
+
The free Public key has access to the following methods:
|
20
|
+
|
21
|
+
movies.theatres.showings
|
22
|
+
|
23
|
+
movies.tv.airings
|
24
|
+
|
25
|
+
programs.new_shows
|
26
|
+
|
27
|
+
sports.event_airings (Not Yet Implemented)
|
28
|
+
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
require 'tmsapi'
|
32
|
+
|
33
|
+
# Create Instace of the API
|
34
|
+
client = TMSAPI::API.new :api_key => 'API_KEY_HERE', :debug => true
|
35
|
+
|
36
|
+
```
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
1. Fork it
|
41
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
44
|
+
5. Create new Pull Request
|
45
|
+
|
46
|
+
## Testing
|
47
|
+
|
48
|
+
```shell
|
49
|
+
bundle install
|
50
|
+
```
|
51
|
+
|
52
|
+
If adding new test:
|
53
|
+
|
54
|
+
```shell
|
55
|
+
RECORDING=1 TMS_API_KEY=your-api-key rspec
|
56
|
+
```
|
57
|
+
|
58
|
+
If running existing tests:
|
59
|
+
|
60
|
+
```shell
|
61
|
+
rspec
|
62
|
+
```
|
data/lib/tmsapi/api.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require File.expand_path('../middleware/custom_logger', __FILE__)
|
2
|
+
|
3
|
+
module TMSAPI
|
4
|
+
class API
|
5
|
+
|
6
|
+
# Creates a new TMS API client instance.
|
7
|
+
#
|
8
|
+
# @param [Hash] params
|
9
|
+
# @option params [String] :api_key The api_key (required)
|
10
|
+
#
|
11
|
+
# @see [Faraday]
|
12
|
+
def initialize(params)
|
13
|
+
@api_key = params[:api_key]
|
14
|
+
@debug = params[:debug]
|
15
|
+
@ssl = params[:ssl] || { :verify => true }
|
16
|
+
@base_url = params[:base_url] || "http://data.tmsapi.com/"
|
17
|
+
@faraday_adapter = params[:faraday_adapter] || Faraday.default_adapter
|
18
|
+
@raise_status_errors = params[:raise_status_errors] || true
|
19
|
+
@faraday = params[:faraday] || default_faraday
|
20
|
+
raise ArgumentError, ':api_key missing' unless @api_key
|
21
|
+
end
|
22
|
+
|
23
|
+
def programs
|
24
|
+
TMSAPI::Resource::Programs.new(@faraday)
|
25
|
+
end
|
26
|
+
|
27
|
+
def stations
|
28
|
+
TMSAPI::Resource::Stations.new(@faraday)
|
29
|
+
end
|
30
|
+
|
31
|
+
def lineups
|
32
|
+
TMSAPI::Resource::Lineups.new(@faraday)
|
33
|
+
end
|
34
|
+
|
35
|
+
def series
|
36
|
+
TMSAPI::Resource::Series.new(@faraday)
|
37
|
+
end
|
38
|
+
|
39
|
+
def movies
|
40
|
+
TMSAPI::Resource::Movies.new(@faraday)
|
41
|
+
end
|
42
|
+
|
43
|
+
def sports
|
44
|
+
TMSAPI::Resource::Sports.new(@faraday)
|
45
|
+
end
|
46
|
+
|
47
|
+
def default_faraday
|
48
|
+
Faraday.new(:url => @base_url, :ssl => @ssl) do |faraday|
|
49
|
+
faraday.use CustomLogger if @debug
|
50
|
+
faraday.request :url_encoded
|
51
|
+
faraday.response :rashify
|
52
|
+
faraday.response :json
|
53
|
+
faraday.use Faraday::Response::RaiseError if @raise_status_errors
|
54
|
+
faraday.adapter @faraday_adapter
|
55
|
+
faraday.params['api_key'] = @api_key
|
56
|
+
faraday.headers['User-Agent'] = "tmsapi rubygem v#{TMSAPI::VERSION}"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module TMSAPI
|
2
|
+
class CustomLogger < Faraday::Middleware
|
3
|
+
extend Forwardable
|
4
|
+
def_delegators :@logger, :debug, :info, :warn, :error, :fatal
|
5
|
+
|
6
|
+
def initialize(app, options = {})
|
7
|
+
@app = app
|
8
|
+
@logger = options.fetch(:logger) {
|
9
|
+
require 'logger'
|
10
|
+
::Logger.new($stdout)
|
11
|
+
}
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
start_time = Time.now
|
16
|
+
info { request_info(env) }
|
17
|
+
debug { request_debug(env) }
|
18
|
+
@app.call(env).on_complete do
|
19
|
+
end_time = Time.now
|
20
|
+
response_time = end_time - start_time
|
21
|
+
info { response_info(env, response_time) }
|
22
|
+
debug { response_debug(env) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def filter(output)
|
29
|
+
unless ENV['DEBUG'] == '2'
|
30
|
+
output = output.to_s.gsub(/api_key=[a-zA-Z0-9-]*/,'api_key=[API-KEY]')
|
31
|
+
else
|
32
|
+
output
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def request_info(env)
|
37
|
+
"Started %s request to: %s" % [ env[:method].to_s.upcase, filter(env[:url]) ]
|
38
|
+
end
|
39
|
+
|
40
|
+
def response_info(env, response_time)
|
41
|
+
"Response from %s; Status: %d; Time: %.1fms" % [ filter(env[:url]), env[:status], (response_time * 1_000.0) ]
|
42
|
+
end
|
43
|
+
|
44
|
+
def request_debug(env)
|
45
|
+
debug_message("Request", env[:request_headers], env[:body])
|
46
|
+
end
|
47
|
+
|
48
|
+
def response_debug(env)
|
49
|
+
debug_message("Response", env[:response_headers], env[:body])
|
50
|
+
end
|
51
|
+
|
52
|
+
def debug_message(name, headers, body)
|
53
|
+
<<-MESSAGE.gsub(/^ +([^ ])/m, '\\1')
|
54
|
+
#{name} Headers:
|
55
|
+
----------------
|
56
|
+
#{format_headers(headers)}
|
57
|
+
|
58
|
+
#{name} Body:
|
59
|
+
-------------
|
60
|
+
#{body}
|
61
|
+
MESSAGE
|
62
|
+
end
|
63
|
+
|
64
|
+
def format_headers(headers)
|
65
|
+
length = headers.map {|k,v| k.to_s.size }.max
|
66
|
+
headers.map { |name, value| "#{name.to_s.ljust(length)} : #{filter(value)}" }.join("\n")
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'tmsapi/model/program'
|
2
|
+
require 'tmsapi/model/station'
|
3
|
+
require 'tmsapi/model/rating'
|
4
|
+
require 'tmsapi/model/quality_rating'
|
5
|
+
|
6
|
+
module TMSAPI
|
7
|
+
module Model
|
8
|
+
class Airing < Base
|
9
|
+
attribute :start_time, String
|
10
|
+
attribute :endTime, String
|
11
|
+
attribute :duration, Integer
|
12
|
+
attribute :ratings, Array[TMSAPI::Model::Rating]
|
13
|
+
attribute :qualifiers, Array[String]
|
14
|
+
attribute :channels, Array[String]
|
15
|
+
attribute :station, TMSAPI::Model::Station
|
16
|
+
attribute :station_id, Integer
|
17
|
+
attribute :program, TMSAPI::Model::Program
|
18
|
+
attribute :release_year, Integer
|
19
|
+
attribute :quality_rating, TMSAPI::Model::QualityRating
|
20
|
+
attribute :entity_type, String
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module TMSAPI
|
2
|
+
module Model
|
3
|
+
class Award < Base
|
4
|
+
attribute :award_id, Integer
|
5
|
+
attribute :award_name, String
|
6
|
+
attribute :category, String
|
7
|
+
attribute :award_cat_id, Integer
|
8
|
+
attribute :year, Integer
|
9
|
+
attribute :recipient, String
|
10
|
+
attribute :person_id, Integer
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'tmsapi/model/caption'
|
2
|
+
|
3
|
+
module TMSAPI
|
4
|
+
module Model
|
5
|
+
class Image < Base
|
6
|
+
attribute :uri, String
|
7
|
+
attribute :height, Integer
|
8
|
+
attribute :width, Integer
|
9
|
+
attribute :primary, String
|
10
|
+
attribute :category, String
|
11
|
+
attribute :tier, String
|
12
|
+
attribute :caption, TMSAPI::Model::Caption
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'tmsapi/model/program'
|
2
|
+
require 'tmsapi/model/showtime'
|
3
|
+
|
4
|
+
module TMSAPI
|
5
|
+
module Model
|
6
|
+
class Movie < Program
|
7
|
+
attribute :release_year, Integer
|
8
|
+
attribute :quality_rating, TMSAPI::Model::QualityRating
|
9
|
+
attribute :sub_type, String
|
10
|
+
attribute :directors, Array[String]
|
11
|
+
attribute :advisories, Array[String]
|
12
|
+
attribute :run_time, String
|
13
|
+
attribute :showtimes, Array[TMSAPI::Model::Showtime]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module TMSAPI
|
2
|
+
module Model
|
3
|
+
class Person < Base
|
4
|
+
attribute :person_id, Integer
|
5
|
+
attribute :name_id, Integer
|
6
|
+
attribute :name, String
|
7
|
+
attribute :role, String
|
8
|
+
attribute :character_name, String
|
9
|
+
attribute :billing_order, Integer
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require "tmsapi/model/award"
|
2
|
+
require "tmsapi/model/image"
|
3
|
+
require "tmsapi/model/person"
|
4
|
+
require "tmsapi/model/rating"
|
5
|
+
require "tmsapi/model/recommendation"
|
6
|
+
|
7
|
+
module TMSAPI
|
8
|
+
module Model
|
9
|
+
class Program < Base
|
10
|
+
attribute :tms_id, String
|
11
|
+
attribute :root_id, Integer
|
12
|
+
attribute :series_id, Integer
|
13
|
+
attribute :active, Boolean
|
14
|
+
attribute :title, String
|
15
|
+
attribute :title_lang, String
|
16
|
+
attribute :short_description, String
|
17
|
+
attribute :long_description, String
|
18
|
+
attribute :description_lang, String
|
19
|
+
attribute :ratings, Array[TMSAPI::Model::Rating]
|
20
|
+
attribute :genres, Array[String]
|
21
|
+
attribute :recommendations, Array[TMSAPI::Model::Recommendation]
|
22
|
+
attribute :top_cast, Array[String]
|
23
|
+
attribute :orig_air_date, String
|
24
|
+
attribute :preferred_image, TMSAPI::Model::Image
|
25
|
+
attribute :sub_type, String
|
26
|
+
attribute :awards, Array[TMSAPI::Model::Award]
|
27
|
+
attribute :cast, Array[TMSAPI::Model::Person]
|
28
|
+
attribute :crew, Array[TMSAPI::Model::Person]
|
29
|
+
#attribute :keywords, WUDUFUQ
|
30
|
+
attribute :total_seasons, Integer
|
31
|
+
attribute :total_episodes, Integer
|
32
|
+
attribute :entity_type, String
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'tmsapi/model/theatre'
|
2
|
+
|
3
|
+
module TMSAPI
|
4
|
+
module Model
|
5
|
+
class Showtime < Base
|
6
|
+
attribute :theatre, TMSAPI::Model::Theatre
|
7
|
+
attribute :barg, Boolean
|
8
|
+
attribute :date_time, String
|
9
|
+
attribute :ticket_uri, String
|
10
|
+
attribute :quals, String
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|