Class: KRPC::Gen::ClassBase

Inherits:
Object
  • Object
show all
Includes:
Doc::SuffixMethods, Streaming::StreamConstructors
Defined in:
lib/krpc/gen.rb

Overview

Base class for service-defined class types.

Constant Summary

Constants included from Streaming::StreamConstructors

Streaming::StreamConstructors::STREAM_METHOD_REGEX, Streaming::StreamConstructors::STREAM_METHOD_SUFFIX

Constants included from Doc::SuffixMethods

Doc::SuffixMethods::DOCSTRING_SUFFIX, Doc::SuffixMethods::DOCSTRING_SUFFIX_REGEX

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Streaming::StreamConstructors

included, #method_missing, #respond_to_missing?

Methods included from Doc::SuffixMethods

included, #method_missing, #respond_to_missing?

Constructor Details

#initialize(client, remote_oid) ⇒ ClassBase

Returns a new instance of ClassBase.



130
131
132
# File 'lib/krpc/gen.rb', line 130

def initialize(client, remote_oid)
  @client, @remote_oid = client, remote_oid
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class KRPC::Streaming::StreamConstructors

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



124
125
126
# File 'lib/krpc/gen.rb', line 124

def client
  @client
end

#remote_oidObject (readonly)

Returns the value of attribute remote_oid.



124
125
126
# File 'lib/krpc/gen.rb', line 124

def remote_oid
  @remote_oid
end

Class Method Details

.krpc_nameObject



126
127
128
# File 'lib/krpc/gen.rb', line 126

def self.krpc_name
  name[11..-1]
end

Instance Method Details

#==(other) ⇒ Object



135
136
137
# File 'lib/krpc/gen.rb', line 135

def ==(other)
  other.class == self.class and other.remote_oid == remote_oid
end

#eql?Object



134
# File 'lib/krpc/gen.rb', line 134

alias_method :eql?, :==

#hashObject



138
139
140
# File 'lib/krpc/gen.rb', line 138

def hash
  remote_oid.hash
end

#inspectObject



146
147
148
# File 'lib/krpc/gen.rb', line 146

def inspect
  "#<#{self.class} ".green + "@remote_oid" + "=".green + remote_oid.to_s.bold.blue + ">".green
end

#to_sObject



142
143
144
# File 'lib/krpc/gen.rb', line 142

def to_s
  "#<#{self.class} @remote_oid=#{remote_oid}>"
end