Class: AddEvent::Url
- Inherits:
-
Object
- Object
- AddEvent::Url
- Defined in:
- lib/add_event/url.rb
Constant Summary collapse
- URL_TEMPLATE =
Addressable::Template.new("https://addevent.to/dir/{?#{Params::KEYS.join(',')}}").freeze
Instance Method Summary collapse
-
#initialize(title:, starts_at:, ends_at:, options: {}) ⇒ AddEvent::Url
constructor
Creates an AddEvent URL.
-
#to_s ⇒ String
Returns the AddEvent URL as a string.
Constructor Details
#initialize(title:, starts_at:, ends_at:, options: {}) ⇒ AddEvent::Url
Creates an AddEvent URL
23 24 25 26 27 28 29 30 |
# File 'lib/add_event/url.rb', line 23 def initialize(title:, starts_at:, ends_at:, options: {}) @title = title @starts_at = starts_at @ends_at = ends_at @params = AddEvent::Params.new(.merge(title: title, starts_at: starts_at, ends_at: ends_at)) end |
Instance Method Details
#to_s ⇒ String
Returns the AddEvent URL as a string
37 38 39 |
# File 'lib/add_event/url.rb', line 37 def to_s URL_TEMPLATE.(@params.to_h).to_s end |