Class: RBus::Variant

Inherits:
Object
  • Object
show all
Defined in:
lib/rbus/etc/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, signature) ⇒ Variant

Returns a new instance of Variant.



31
32
33
34
# File 'lib/rbus/etc/types.rb', line 31

def initialize(object, signature)
  @object_signature = signature
  @object = object
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



36
37
38
# File 'lib/rbus/etc/types.rb', line 36

def method_missing(name, *args, &block)
  @object.send(name, *args, &block)
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



30
31
32
# File 'lib/rbus/etc/types.rb', line 30

def object
  @object
end

#object_signatureObject (readonly)

Returns the value of attribute object_signature.



30
31
32
# File 'lib/rbus/etc/types.rb', line 30

def object_signature
  @object_signature
end

Instance Method Details

#==(other) ⇒ Object



40
41
42
# File 'lib/rbus/etc/types.rb', line 40

def ==(other)
  other.object_signature == @object_signature && other.object == @object
end

#to_fObject



52
53
54
# File 'lib/rbus/etc/types.rb', line 52

def to_f
  @object.to_f
end

#to_iObject



48
49
50
# File 'lib/rbus/etc/types.rb', line 48

def to_i
  @object.to_i
end

#to_sObject



44
45
46
# File 'lib/rbus/etc/types.rb', line 44

def to_s
  @object.to_s
end