Class: TrueURL
- Inherits:
-
Object
- Object
- TrueURL
- Defined in:
- lib/true_url.rb,
lib/true_url/context.rb,
lib/true_url/version.rb,
lib/true_url/strategy.rb,
lib/true_url/strategy/vimeo.rb,
lib/true_url/strategy/twitter.rb,
lib/true_url/strategy/youtube.rb,
lib/true_url/strategy/nicovideo.rb,
lib/true_url/strategy/dailymotion.rb more...
Defined Under Namespace
Modules: Strategy Classes: Context
Constant Summary collapse
- OPTIONS =
{ scheme_override: nil, # Possible choices: "https", "http", nil (preserve scheme) fetch: true # Whether to fetch the URL }.freeze
- QUERY_VALUES_TO_REMOVE =
%w( utm_source utm_medium utm_term utm_content utm_campaign sms_ss awesm xtor PHPSESSID ).freeze
- VERSION =
'0.0.3'.freeze
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#strategies ⇒ Object
Returns the value of attribute strategies.
Instance Method Summary collapse
- #attributes ⇒ Object
- #canonical ⇒ Object
-
#initialize(url, options = {}) ⇒ TrueURL
constructor
A new instance of TrueURL.
Constructor Details
permalink #initialize(url, options = {}) ⇒ TrueURL
Returns a new instance of TrueURL.
26 27 28 29 30 |
# File 'lib/true_url.rb', line 26 def initialize(url, = {}) @context = TrueURL::Context.new(url, OPTIONS.merge()) @strategies = TrueURL::Strategy.default_list @executed = false end |
Instance Attribute Details
permalink #context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/true_url.rb', line 7 def context @context end |
permalink #strategies ⇒ Object
Returns the value of attribute strategies.
7 8 9 |
# File 'lib/true_url.rb', line 7 def strategies @strategies end |
Instance Method Details
permalink #attributes ⇒ Object
[View source]
37 38 39 40 |
# File 'lib/true_url.rb', line 37 def attributes execute @context.attributes end |
permalink #canonical ⇒ Object
[View source]
32 33 34 35 |
# File 'lib/true_url.rb', line 32 def canonical execute @context.working_url.to_s end |