Sha256: e88f31c232070dbe8f89652a2d11c9fd4229056d862ab66c59b43d82513b443e

Contents?: true

Size: 380 Bytes

Versions: 1

Compression:

Stored size: 380 Bytes

Contents

# Namespace for the Opushon library.
module Opushon
  module Type
    # Abstract class.
    class Base
      def initialize(*)
        freeze
      end

      def to_h
        {
          type: to_sym
        }.merge(constraints)
      end

      def to_sym
        self.class.name.split('::').last.downcase
      end

      def constraints
        {}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opushon-0.1.0 lib/opushon/type/base.rb