Shiva Kumar 's Blog

Start small,Think Big

structs

Struct in Ruby

Struct is a simple way to create a class with number of attributes without explicitly creating a class Syntax to create a class using struct 1.9.2p290 :004 > Struct.new(“User”,:name,:email) Where User is the class name.Name and email are the attributes of the class where passing it on the fly. So when you want to create [...]

, , , , ,