Sha256: 42902c1665fd36f0713f29cd420f357bb97ea3d537a4146e4f7df2a5200a7656

Contents?: true

Size: 289 Bytes

Versions: 4

Compression:

Stored size: 289 Bytes

Contents

module Stratify
  class FieldDefinition
    attr_reader :name, :type, :label

    def initialize(name, attribute_hash)
      @name = name
      @type = attribute_hash[:type]
      @label = attribute_hash[:label]
    end

    def label
      @label || @name.to_s.titleize
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stratify-base-0.1.4 lib/stratify/field_definition.rb
stratify-base-0.1.3 lib/stratify/field_definition.rb
stratify-base-0.1.2 lib/stratify/field_definition.rb
stratify-base-0.1.0 lib/stratify/field_definition.rb