Class: KRPC::Gen::ClassBase
- Inherits:
-
Object
- Object
- KRPC::Gen::ClassBase
- 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
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#remote_oid ⇒ Object
readonly
Returns the value of attribute remote_oid.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql? ⇒ Object
- #hash ⇒ Object
-
#initialize(client, remote_oid) ⇒ ClassBase
constructor
A new instance of ClassBase.
- #inspect ⇒ Object
- #to_s ⇒ Object
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
124 125 126 |
# File 'lib/krpc/gen.rb', line 124 def client @client end |
#remote_oid ⇒ Object (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_name ⇒ Object
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?, :== |
#hash ⇒ Object
138 139 140 |
# File 'lib/krpc/gen.rb', line 138 def hash remote_oid.hash end |
#inspect ⇒ Object
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_s ⇒ Object
142 143 144 |
# File 'lib/krpc/gen.rb', line 142 def to_s "#<#{self.class} @remote_oid=#{remote_oid}>" end |