Sha256: 0ab3da787140de694e1b3cb12e38ecc3f95453c277ee31ab7e534f6536ba7683

Contents?: true

Size: 427 Bytes

Versions: 15

Compression:

Stored size: 427 Bytes

Contents

module PgSerializable
  module Nodes
    class Attribute < Base
      attr_reader :column_name, :klass, :label, :prc

      def initialize(klass, column_name, label: nil, &prc)
        @klass = klass
        @column_name = column_name
        @label = label || column_name
        @prc = prc if block_given?
      end

      def enum?
        @enum ||= klass.defined_enums.has_key? column_name.to_s
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pg_serializable-3.1.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-3.0.2 lib/pg_serializable/nodes/attribute.rb
pg_serializable-3.0.1 lib/pg_serializable/nodes/attribute.rb
pg_serializable-3.0.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-2.1.1 lib/pg_serializable/nodes/attribute.rb
pg_serializable-2.1.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-2.0.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.4.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.3.2 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.3.1 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.3.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.2.2 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.2.1 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.2.0 lib/pg_serializable/nodes/attribute.rb
pg_serializable-1.1.0 lib/pg_serializable/nodes/attribute.rb