Class: DataTransport::Record::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/data_transport/record/source.rb

Overview

:nodoc:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/data_transport/record/source.rb', line 12

def method_missing(name, *args)
  if @record.has_key?(name)
    unless args.empty?
      raise ArgumentError, "wrong number of arguments (#{args.length} for 0)"
    end
    @record[name]
  else
    super
  end
end

Instance Method Details

#idObject



8
9
10
# File 'lib/data_transport/record/source.rb', line 8

def id
  method_missing :id
end

#record=(record) ⇒ Object



4
5
6
# File 'lib/data_transport/record/source.rb', line 4

def record=(record)
  @record = record
end