Sha256: e945b3c82d32b47c348a15d0ac4707236f847f81b397532071d1139479a1329c

Contents?: true

Size: 374 Bytes

Versions: 2

Compression:

Stored size: 374 Bytes

Contents

module ContentState
  class Factory
    def self.new(state_name)
      return ContentState::New.instance if !state_name || state_name.blank?
      state_name = state_name.to_s.underscore
      unless state_name.rindex('/')
        state_name = 'content_state/' + state_name
      end
      require state_name
      state_name.camelize.constantize.instance
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
typo-4.1.1 app/models/content_state/factory.rb
typo-4.1 app/models/content_state/factory.rb