Sha256: e5b09f3071893ff9f8b238421f42dde1e7e27fb9e25594aba4c5cfe130a4033a

Contents?: true

Size: 371 Bytes

Versions: 14

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

module Sail
  module Types
    # ObjModel
    #
    # The ObjModel type returns the constant
    # for a given string saved.
    # For example:
    #
    # If the saved value is +"Post"+,
    # it will return +Post+ (actual class).
    class ObjModel < Type
      def to_value
        @setting.value.constantize
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sail-3.6.1 lib/sail/types/obj_model.rb
sail-3.6.0 lib/sail/types/obj_model.rb
sail-3.5.1 lib/sail/types/obj_model.rb
sail-3.5.0 lib/sail/types/obj_model.rb
sail-3.4.0 lib/sail/types/obj_model.rb
sail-3.3.0 lib/sail/types/obj_model.rb
sail-3.2.4 lib/sail/types/obj_model.rb
sail-3.2.3 lib/sail/types/obj_model.rb
sail-3.2.2 lib/sail/types/obj_model.rb
sail-3.2.1 lib/sail/types/obj_model.rb
sail-3.2.0 lib/sail/types/obj_model.rb
sail-3.1.0 lib/sail/types/obj_model.rb
sail-3.0.1 lib/sail/types/obj_model.rb
sail-3.0.0 lib/sail/types/obj_model.rb