Sha256: e0891139989a17f5af9b0b774c5c3090861587b991154e70c0d9a898aa1c8e8c

Contents?: true

Size: 356 Bytes

Versions: 4

Compression:

Stored size: 356 Bytes

Contents

module ContentState
  class Factory
    def self.new(state_name)
      return ContentState::New.instance unless state_name
      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

4 entries across 4 versions & 1 rubygems

Version Path
typo-4.0.1 app/models/content_state/factory.rb
typo-4.0.0 app/models/content_state/factory.rb
typo-4.0.2 app/models/content_state/factory.rb
typo-4.0.3 app/models/content_state/factory.rb