Class: Locomotive::Steam::Liquid::Drops::SectionUrlField

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/locomotive/steam/liquid/drops/section_content_proxy.rb

Overview

Drop representing the value of an url attribute

Instance Method Summary collapse

Constructor Details

#initialize(url, new_window = false) ⇒ SectionUrlField

Returns a new instance of SectionUrlField.



87
88
89
# File 'lib/locomotive/steam/liquid/drops/section_content_proxy.rb', line 87

def initialize(url, new_window = false)
  @url, @new_window = url, new_window
end

Instance Method Details

#new_windowObject



91
92
93
# File 'lib/locomotive/steam/liquid/drops/section_content_proxy.rb', line 91

def new_window
  @new_window
end

#new_window_attributeObject



95
96
97
# File 'lib/locomotive/steam/liquid/drops/section_content_proxy.rb', line 95

def new_window_attribute
  !!@new_window ? 'target="_blank"' : ''
end

#present?Boolean

Returns:

  • (Boolean)


99
100
101
# File 'lib/locomotive/steam/liquid/drops/section_content_proxy.rb', line 99

def present?
  @url.present?
end

#to_sObject



103
104
105
# File 'lib/locomotive/steam/liquid/drops/section_content_proxy.rb', line 103

def to_s
  @url
end