Class: ROM::OpenStruct

Inherits:
Object
  • Object
show all
Defined in:
core/lib/rom/open_struct.rb

Overview

ROM's open structs are used for relations with empty schemas. Such relations may exist in cases like using raw SQL strings where schema was not explicitly defined using view DSL.

Constant Summary collapse

IVAR =
-> v { :"@#{v}" }

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



27
28
29
30
31
32
33
34
35
# File 'core/lib/rom/open_struct.rb', line 27

def method_missing(meth, *args, &block)
  ivar = IVAR[meth]

  if instance_variables.include?(ivar)
    instance_variable_get(ivar)
  else
    super
  end
end