Class: KRPC::Types::ClassType

Inherits:
TypeBase
  • Object
show all
Defined in:
lib/krpc/types.rb

Instance Attribute Summary collapse

Attributes inherited from TypeBase

#protobuf_type, #ruby_type

Instance Method Summary collapse

Constructor Details

#initialize(type_string) ⇒ ClassType

Returns a new instance of ClassType.

Raises:



161
162
163
164
165
166
# File 'lib/krpc/types.rb', line 161

def initialize(type_string)
  m = /Class\(([^\.]+)\.([^\.]+)\)/.match type_string
  raise(ValueError, "\"#{type_string}\" is not a valid type string for a class type") unless m
  @service_name, @class_name = m[1..2]
  super(type_string, Gen.generate_class(service_name, class_name))
end

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



160
161
162
# File 'lib/krpc/types.rb', line 160

def class_name
  @class_name
end

#service_nameObject (readonly)

Returns the value of attribute service_name.



160
161
162
# File 'lib/krpc/types.rb', line 160

def service_name
  @service_name
end