Class: Seofy::Adapters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/seofy/adapters/base.rb

Direct Known Subclasses

Base36, ExistingColumn

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



5
6
7
8
# File 'lib/seofy/adapters/base.rb', line 5

def initialize(options={})        
  @options = options
  @column = options[:column]
end

Instance Attribute Details

#columnObject (readonly)

Returns the value of attribute column.



4
5
6
# File 'lib/seofy/adapters/base.rb', line 4

def column
  @column
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/seofy/adapters/base.rb', line 4

def options
  @options
end

Instance Method Details

#after_create(inst) ⇒ Object



22
23
24
# File 'lib/seofy/adapters/base.rb', line 22

def after_create(inst)
  # do nothing
end

#before_create(inst) ⇒ Object



18
19
20
# File 'lib/seofy/adapters/base.rb', line 18

def before_create(inst)
  set_seofy_slug(inst)
end

#need_update_slug?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/seofy/adapters/base.rb', line 26

def need_update_slug?
  true
end

#seofy_slug(inst) ⇒ Object



10
11
12
# File 'lib/seofy/adapters/base.rb', line 10

def seofy_slug(inst)
  raise "not implement"
end

#set_seofy_slug(inst) ⇒ Object



14
15
16
# File 'lib/seofy/adapters/base.rb', line 14

def set_seofy_slug(inst)
  raise "not implement"
end