class It::Link

A class for links

Attributes

href[R]

Public Class Methods

new(href, options = {}) click to toggle source

See It.link for details. You can do everything there and save 6 characters.

Calls superclass method
# File lib/it/link.rb, line 9
def initialize(href, options = {})
  raise TypeError, 'Invalid href given' unless [Hash, String, ActiveSupport::SafeBuffer].include?(href.class)

  super(:a, options)
  @href = href
end

Public Instance Methods

process(content) click to toggle source

Will be called from inside the helper to return the tag with the given content.

# File lib/it/link.rb, line 17
def process(content)
  link_to(content, href, options)
end