Class: Kiosk::Origin
- Inherits:
-
Object
- Object
- Kiosk::Origin
- Defined in:
- lib/kiosk/origin.rb
Instance Attribute Summary collapse
-
#cdn ⇒ Object
readonly
Returns the value of attribute cdn.
-
#default_locale ⇒ Object
readonly
Returns the value of attribute default_locale.
-
#indexer ⇒ Object
readonly
Returns the value of attribute indexer.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(config) ⇒ Origin
constructor
A new instance of Origin.
- #searcher ⇒ Object
- #site_uri ⇒ Object
Constructor Details
#initialize(config) ⇒ Origin
Returns a new instance of Origin.
5 6 7 8 9 10 |
# File 'lib/kiosk/origin.rb', line 5 def initialize(config) @site = (config['site'] || '').sub(/\/+$/, '') + '/' @indexer = Kiosk::Indexer::Adapter.new(config['indexer']) if config['indexer'] @default_locale = config['default_locale'] @cdn = Kiosk::Cdn.new(config['cdn'] || {}) end |
Instance Attribute Details
#cdn ⇒ Object (readonly)
Returns the value of attribute cdn.
3 4 5 |
# File 'lib/kiosk/origin.rb', line 3 def cdn @cdn end |
#default_locale ⇒ Object (readonly)
Returns the value of attribute default_locale.
3 4 5 |
# File 'lib/kiosk/origin.rb', line 3 def default_locale @default_locale end |
#indexer ⇒ Object (readonly)
Returns the value of attribute indexer.
3 4 5 |
# File 'lib/kiosk/origin.rb', line 3 def indexer @indexer end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
3 4 5 |
# File 'lib/kiosk/origin.rb', line 3 def site @site end |
Instance Method Details
#searcher ⇒ Object
12 13 14 |
# File 'lib/kiosk/origin.rb', line 12 def searcher @indexer end |
#site_uri ⇒ Object
16 17 18 |
# File 'lib/kiosk/origin.rb', line 16 def site_uri URI.parse(site) end |