Class: Storey::Suffixifier

Inherits:
Object
  • Object
show all
Defined in:
lib/storey/suffixifier.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema_name) ⇒ Suffixifier

Returns a new instance of Suffixifier.



8
9
10
# File 'lib/storey/suffixifier.rb', line 8

def initialize(schema_name)
  @schema_name = schema_name
end

Class Method Details

.suffixify(*args) ⇒ Object



4
5
6
# File 'lib/storey/suffixifier.rb', line 4

def self.suffixify(*args)
  self.new(*args).suffixify
end

Instance Method Details

#suffixifyObject



12
13
14
15
16
17
18
19
20
# File 'lib/storey/suffixifier.rb', line 12

def suffixify
  schema_names.map do |schema_name|
    if schema_name =~ /\w+#{suffix}/ || native_schema?(schema_name)
      schema_name
    else
      "#{schema_name}#{suffix}"
    end
  end.join(',')
end