BOpenStruct attributes can only be accessed using hash syntax
COpenStruct requires all attributes to be defined in advance
DOpenStruct allows adding and changing attributes dynamically at runtime
Step-by-Step Solution
Solution:
Step 1: Recall OpenStruct behavior
OpenStruct objects allow dynamic addition and modification of attributes anytime.
Step 2: Evaluate each statement
Immutability claim is false; objects are mutable. Hash syntax only is false; uses dot notation. All attributes predefined is false; dynamic addition allowed. Adding and changing dynamically at runtime is true.
Final Answer:
OpenStruct allows adding and changing attributes dynamically at runtime -> Option D
Quick Check:
OpenStruct mutability and dynamic attributes = true [OK]
Quick Trick:OpenStruct attributes are dynamic and mutable [OK]
Common Mistakes:
Thinking OpenStruct is immutable
Assuming attributes must be predefined
Using hash syntax for access
Master "Metaprogramming Fundamentals" in Ruby
9 interactive learning modes - each teaches the same concept differently