Sha256: 5b5d96043d54382b46e82edee4a0c4e03215139a8b4a67cdb1235ff2f11ef791

Contents?: true

Size: 400 Bytes

Versions: 8

Compression:

Stored size: 400 Bytes

Contents

module Metro2
  module Records
    class Record
      @fields = []

      class << self
        def fields
          @fields
        end
      end

      extend(Fields)

      def to_metro2
        validate_fields
        self.class.fields.collect { |f| send("#{f}_to_metro2") }.join
      end

      def validate_fields
        # this should be implemented by each child
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
metro_2-1.2.7 lib/metro_2/records/record.rb
metro_2-1.2.6 lib/metro_2/records/record.rb
metro_2-1.2.5 lib/metro_2/records/record.rb
metro_2-1.2.4 lib/metro_2/records/record.rb
metro2_format-1.0.0 lib/metro_2/records/record.rb
metro_2-1.2.3 lib/metro_2/records/record.rb
metro_2-1.2.2 lib/metro_2/records/record.rb
metro_2-1.2.1 lib/metro_2/records/record.rb