Class: Zemus::Generic

Inherits:
Object
  • Object
show all
Defined in:
lib/zemus/generic.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Generic

Returns a new instance of Generic.



8
9
10
# File 'lib/zemus/generic.rb', line 8

def initialize(url)
  @url = url
end

Class Method Details

.valid?(url) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/zemus/generic.rb', line 4

def self.valid?(url)
  true
end

Instance Method Details

#to_embedObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/zemus/generic.rb', line 12

def to_embed
  url = @url

  display = url
  if display.length > 40
    display = "#{display[0,40]}.."
  end

  "<a href='#{url}' target='_blank'>#{display}</a>"
end