Skip to content

Commit

Permalink
Merge pull request #8 from JuzerShakir/readme
Browse files Browse the repository at this point in the history
Update Documentation
  • Loading branch information
JuzerShakir authored Dec 28, 2024
2 parents 4141bdf + ea07d35 commit 9c55c74
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
ruby-version: "3.3.6"
- name: Install dependencies
run: bundle install
- name: Run analysis
Expand Down
99 changes: 78 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,97 @@ gem 'imdb_title'

Then run `bundle install`.

or run this command in your console to install gem locally:

```ruby
gem install imdb_title
```

## Usage

### Here's an example

```ruby
require 'imdb_title'

# input a valid URL of any Movie, Tv-Show, Episode or Game from imdb.com
movie = IMDb::Title.new("https://www.imdb.com/title/tt0111161")

movie.title #=> The Shawshank Redemption
movie.budget #=> $25,000,000
movie.casts.first(2) #=> ["Tim Robbins", "Morgan Freeman"]
movie.directors #=> ["Frank Darabont"]
movie.duration #=> 2 hours 22 minutes
movie.tagline #=> Over the course of several years, two convicts...
movie.genres #=> ["Drama"]
movie.imdb_id #=> tt0111161
movie.popularity #=> 2.8M
movie.production_companies #=> ["Castle Rock Entertainment"]
movie.ratings #=> 9.3
movie.release_date #=> October 14, 1994 (India)
movie.revenue #=> $28,884,716
movie.tagline #=> Over the course of several years, two convicts...

movie.ancestors #=> [IMDb::Title, Object, PP::ObjectMixin, ...]
movie.singleton_class.ancestors #=> <Class:#<IMDb::Title:0x00007f4a0bf22a40>>, Movie, NonInteractive, IMDb::Title, Object, PP::ObjectMixin, ...]
```

These will return an `array` type:

1. `casts`
2. `production_companies`
3. `directors`
4. `genres`

All other methods will return `string` type.

> If any of the following features are not available or mentioned on IMDb for that particular title then it will return `nil`.
---

### Available Methods

<details>
<summary>
<b>ALL title types</b>
</summary>
<ol>
<li>title</li>
<li>tagline</li>
<li>genres</li>
<li>ratings</li>
<li>popularity</li>
<li>directors</li>
<li>production_companies</li>
<li>casts</li>
<li>release_date</li>
<li>imdb_id</li>
<li>url</li>
</ol>
</details>

<br>

<details>
<summary>
<b>ALL title types EXCEPT Game</b>
</summary>
<ol>
<li>duration</li>
</ol>
</details>

<br>

<details>
<summary>
<b>ONLY for Movie title</b>
</summary>
<ol>
<li>budget</li>
<li>revenue</li>
</ol>
</details>

---

### Return Types

<details>
<summary>
<b>Array types:</b>
</summary>
<ol>
<li>casts</li>
<li>genres</li>
<li>directors</li>
<li>production_companies</li>

</ol>
</details>

<br>

> All other methods will return `string` type.
## Contributing

Expand All @@ -79,7 +136,7 @@ Thank you, contributors!

## Versioning

ImdbTitle follows Semantic Versioning 2.0 as defined at https://semver.org.
ImdbTitle follows Semantic Versioning 2.0 as defined at <https://semver.org>.

## License

Expand Down

0 comments on commit 9c55c74

Please sign in to comment.