Module: Linkify::Model::Base

Included in:
ActiveRecord
Defined in:
lib/linkify/models/base.rb

Instance Method Summary collapse

Instance Method Details

#linkableObject



24
25
26
# File 'lib/linkify/models/base.rb', line 24

def linkable
  linky_options[:linkable]
end

#linkable_byObject



20
21
22
# File 'lib/linkify/models/base.rb', line 20

def linkable_by
  fail
end

#linkable_methodObject



36
37
38
# File 'lib/linkify/models/base.rb', line 36

def linkable_method
  linky_options[:finder_method]
end

#linkable_pathObject



32
33
34
# File 'lib/linkify/models/base.rb', line 32

def linkable_path
  linky_options[:user_path]
end

#linkable_recordsObject



40
41
42
43
44
45
46
# File 'lib/linkify/models/base.rb', line 40

def linkable_records
  if linkable_method == :all
    all
  else
    linkable_method
  end
end

#linkable_titleObject



28
29
30
# File 'lib/linkify/models/base.rb', line 28

def linkable_title
  linky_options[:user_title]
end

#linky_optionsObject



10
11
12
13
14
15
16
17
18
# File 'lib/linkify/models/base.rb', line 10

def linky_options
  if defined?(@linky_options)
    @linky_options
  elsif superclass.respond_to?(:linky_options)
    superclass.linky_options || { }
  else
    { }
  end
end