Class: OpenStruct

Inherits:
Object
  • Object
show all
Defined in:
lib/starwars/overrides/ostruct.rb

Overview

ostruct for ruby 1.9 doesn’t implement [] operater This a monkey patch my copying the ruby 2.0 version

Direct Known Subclasses

Starwars::Base

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object

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.

Fetch an object by id or URL

Parameters:

  • name (String)

Returns:

  • (Object)


13
14
15
# File 'lib/starwars/overrides/ostruct.rb', line 13

def [](name)
  @table[name.to_sym]
end