Class: BatchFactory::HashedWorksheet

Inherits:
Object
  • Object
show all
Defined in:
lib/batch_factory/hashed_worksheet.rb

Constant Summary collapse

@@proxy_methods =
Enumerable.public_instance_methods + Array.public_instance_methods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keys, rows) ⇒ HashedWorksheet

Returns a new instance of HashedWorksheet.



7
8
9
10
# File 'lib/batch_factory/hashed_worksheet.rb', line 7

def initialize(keys, rows)
  @keys = keys
  @rows = rows
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/batch_factory/hashed_worksheet.rb', line 12

def method_missing(method, *args, &block)
  if should_proxy_method?(method.to_sym)
    @rows.send(method, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#keysObject

Returns the value of attribute keys.



3
4
5
# File 'lib/batch_factory/hashed_worksheet.rb', line 3

def keys
  @keys
end

#rowsObject

Returns the value of attribute rows.



3
4
5
# File 'lib/batch_factory/hashed_worksheet.rb', line 3

def rows
  @rows
end