Class: Struct

Inherits:
Object show all
Defined in:
lib/linkparser/utils.rb

Overview

Minor addition to the behavior of a struct.

Direct Known Subclasses

Definition, LinkParser::ParseState

Instance Method Summary collapse

Instance Method Details

#update(obj) ⇒ Object

Using either another struct or a hash, updates all the values of this instance of a struct.



197
198
199
200
201
202
# File 'lib/linkparser/utils.rb', line 197

def update(obj)
	self.members.each {|member|
		self[member.to_s] = obj[member.intern] || self[member]
	}
	self
end