Module: GS1::Barcode::Definitions::ClassMethods

Defined in:
lib/gs1/barcode/definitions.rb

Overview

Adding defintion class methods.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#recordsObject (readonly)

Returns the value of attribute records.



13
14
15
# File 'lib/gs1/barcode/definitions.rb', line 13

def records
  @records
end

Instance Method Details

#define_records(*records) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/gs1/barcode/definitions.rb', line 15

def define_records(*records)
  @records ||= []
  @records = records

  records.each do |record|
    attr_reader record.underscore_name
  end
end