Class: MagicModelsGenerator::ModelHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/magic_model_generator/schema.rb

Instance Method Summary collapse

Methods inherited from Hash

#merge_with_prefix, #merge_with_prefix!, #pass

Instance Method Details

#[](class_id) ⇒ Object



195
196
197
198
199
# File 'lib/magic_model_generator/schema.rb', line 195

def [](class_id)
  enquired?(class_id = class_id.to_s)
  @enquired[class_id] = true
  super(class_id)
end

#enquired?(class_id) ⇒ Boolean

Returns:

  • (Boolean)


190
191
192
193
# File 'lib/magic_model_generator/schema.rb', line 190

def enquired?(class_id)
  @enquired ||= {}
  @enquired[class_id.to_s]
end

#unenquire(class_id) ⇒ Object



185
186
187
188
# File 'lib/magic_model_generator/schema.rb', line 185

def unenquire(class_id)
  @enquired ||= {}
  @enquired[class_id = class_id.to_s] = false
end