Class: Murlsh::Url
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Murlsh::Url
- Defined in:
- lib/murlsh/url.rb
Overview
URL ActiveRecord.
Instance Attribute Summary (collapse)
-
- (Object) user_supplied_title
(also: #user_supplied_title?)
Returns the value of attribute user_supplied_title.
Instance Method Summary (collapse)
- - (Object) ask
-
- (Boolean) same_author?(other)
Return true if this url has the same author as another url.
-
- (Object) title
Get the title of this url.
-
- (Object) title_stripped
Title with whitespace compressed and leading and trailing whitespace stripped.
Instance Attribute Details
- (Object) user_supplied_title Also known as: user_supplied_title?
Returns the value of attribute user_supplied_title
39 40 41 |
# File 'lib/murlsh/url.rb', line 39 def user_supplied_title @user_supplied_title end |
Instance Method Details
- (Object) ask
32 33 34 35 36 37 |
# File 'lib/murlsh/url.rb', line 32 def ask if !defined?(@ask) or @ask.to_s != url @ask = URI(url).extend(Murlsh::UriAsk) end @ask end |
- (Boolean) same_author?(other)
Return true if this url has the same author as another url.
27 28 29 30 |
# File 'lib/murlsh/url.rb', line 27 def (other) other and other.email and other.name and email and name and email == other.email and name == other.name end |
- (Object) title
Get the title of this url.
12 13 14 15 16 17 18 19 20 |
# File 'lib/murlsh/url.rb', line 12 def title ta = read_attribute(:title) ta = nil if ta and ta.empty? ua = read_attribute(:url) ua = nil if ua and ua.empty? ta || ua || 'title missing' end |
- (Object) title_stripped
Title with whitespace compressed and leading and trailing whitespace stripped.
24 |
# File 'lib/murlsh/url.rb', line 24 def title_stripped; title.strip.gsub(/\s+/, ' '); end |