Class: PicturehouseUk::Cinema
- Inherits:
-
Cinebase::Cinema
- Object
- Cinebase::Cinema
- PicturehouseUk::Cinema
- Defined in:
- lib/picturehouse_uk/cinema.rb
Overview
The object representing a cinema on the Picturehouse UK website
Defined Under Namespace
Classes: ListParser
Constant Summary collapse
- ADDRESS_CSS =
address css
'.static-content #contact-us + p:first'.freeze
- CINEMA_LINKS_CSS =
cinema link css
'.footer .col-sm-3 option + option'.freeze
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The numeric id of the cinema on the Cineworld website.
Class Method Summary collapse
-
.all ⇒ Array<PicturehouseUk::Cinema>
Return basic cinema information for all cinemas.
- .cinema_hash ⇒ Object private
Instance Method Summary collapse
-
#address ⇒ Hash
Address of the cinema.
-
#adr ⇒ Hash
Address of the cinema :locality, :postal_code, :country.
-
#brand ⇒ String
Brand of the cinema.
-
#country_name ⇒ String
Country of the cinema.
-
#extended_address ⇒ String
The second address line of the cinema.
-
#full_name ⇒ String
The name of the cinema (might include brand).
-
#initialize(options) ⇒ PicturehouseUk::Cinema
constructor
Constructor.
-
#locality ⇒ String
The locality (town) of the cinema.
-
#name ⇒ String
The name of the cinema.
-
#postal_code ⇒ String
Post code of the cinema.
-
#region ⇒ String
The region (county) of the cinema if provided.
-
#slug ⇒ String
The URL-able slug of the cinema.
-
#street_address ⇒ String
The street address of the cinema.
-
#url ⇒ String
The url of the cinema on the Picturehouse website.
Constructor Details
#initialize(options) ⇒ PicturehouseUk::Cinema
Constructor
|
# File 'lib/picturehouse_uk/cinema.rb', line 12
|
Instance Attribute Details
#id ⇒ Integer (readonly)
Returns the numeric id of the cinema on the Cineworld website.
|
# File 'lib/picturehouse_uk/cinema.rb', line 9
|
Class Method Details
.all ⇒ Array<PicturehouseUk::Cinema>
Return basic cinema information for all cinemas
22 23 24 |
# File 'lib/picturehouse_uk/cinema.rb', line 22 def self.all cinema_hash.keys.map { |id| new(id) } end |
.cinema_hash ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/picturehouse_uk/cinema.rb', line 27 def self.cinema_hash @cinema_hash ||= ListParser.new(cinema_links).to_hash end |
Instance Method Details
#address ⇒ Hash
Address of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 31
|
#adr ⇒ Hash
Uses method naming as at microformats.org/wiki/adr
Address of the cinema :locality, :postal_code, :country
51 52 53 |
# File 'lib/picturehouse_uk/cinema.rb', line 51 def adr PicturehouseUk::Internal::Parser::Address.new(address_node.to_s).address end |
#brand ⇒ String
Brand of the cinema
61 62 63 |
# File 'lib/picturehouse_uk/cinema.rb', line 61 def brand 'Picturehouse'.freeze end |
#country_name ⇒ String
Country of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 65
|
#extended_address ⇒ String
The second address line of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 73
|
#full_name ⇒ String
The name of the cinema (might include brand)
87 88 89 |
# File 'lib/picturehouse_uk/cinema.rb', line 87 def full_name name end |
#locality ⇒ String
The locality (town) of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 91
|
#name ⇒ String
The name of the cinema
105 106 107 |
# File 'lib/picturehouse_uk/cinema.rb', line 105 def name self.class.cinema_hash.fetch(id, {})[:name] end |
#postal_code ⇒ String
Post code of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 109
|
#region ⇒ String
The region (county) of the cinema if provided
|
# File 'lib/picturehouse_uk/cinema.rb', line 117
|
#slug ⇒ String
The URL-able slug of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 125
|
#street_address ⇒ String
The street address of the cinema
|
# File 'lib/picturehouse_uk/cinema.rb', line 133
|
#url ⇒ String
The url of the cinema on the Picturehouse website
143 144 145 |
# File 'lib/picturehouse_uk/cinema.rb', line 143 def url "http://www.picturehouses.com#/cinema/#{id}" end |