Class: Fixturama::Loader::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/fixturama/loader/context.rb

Overview

The context of some fixture

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object (private)



27
28
29
# File 'lib/fixturama/loader/context.rb', line 27

def method_missing(name, *args)
  @values.respond_to?(name) ? @values.send(name, *args) : super
end

Instance Method Details

#[](key) ⇒ Object

Get value by key

Parameters:

  • key (#to_s)

Returns:

  • (Object)


10
11
12
# File 'lib/fixturama/loader/context.rb', line 10

def [](key)
  @values.send(key).instance_variable_get(:@value)
end