Class: IG3Marshal

Inherits:
Object
  • Object
show all
Defined in:
lib/ig3client/marshal_client.rb

Overview

Capture serialised IG3Marshal Object

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ IG3Marshal

Returns a new instance of IG3Marshal.



14
15
16
# File 'lib/ig3client/marshal_client.rb', line 14

def initialize(attributes)
	@attributes = attributes
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args) ⇒ Object



32
33
34
# File 'lib/ig3client/marshal_client.rb', line 32

def method_missing(sym,*args)
	self[sym]
end

Instance Method Details

#[](k) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/ig3client/marshal_client.rb', line 22

def [](k)
	k = k.to_s
	if @attributes.include? k
		return @attributes[k]
	else
		keys = @attributes.keys.join(', ')
		warn "No such attribute: #{k.to_s} (#{keys})"
		return nil
	end
end

#real_idObject



18
19
20
# File 'lib/ig3client/marshal_client.rb', line 18

def real_id
	@attributes["id"]
end