Class: Introspection::Method
- Extended by:
- Forwardable
- Defined in:
- lib/introspection/method.rb
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(method, visibility = :public) ⇒ Method
constructor
A new instance of Method.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(method, visibility = :public) ⇒ Method
Returns a new instance of Method.
12 13 14 |
# File 'lib/introspection/method.rb', line 12 def initialize(method, visibility = :public) @method, @visibility = method, visibility end |
Instance Attribute Details
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
10 11 12 |
# File 'lib/introspection/method.rb', line 10 def visibility @visibility end |
Instance Method Details
#==(other) ⇒ Object
16 17 18 |
# File 'lib/introspection/method.rb', line 16 def ==(other) (owner == other.owner) && (name == other.name) && (visibility == other.visibility) end |
#eql?(other) ⇒ Boolean
20 21 22 |
# File 'lib/introspection/method.rb', line 20 def eql?(other) (self.class === other) && (self == other) end |
#hash ⇒ Object
24 25 26 |
# File 'lib/introspection/method.rb', line 24 def hash [owner, name, visibility].hash end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/introspection/method.rb', line 32 def inspect "#{owner}##{name} (#{visibility})" end |
#name ⇒ Object
28 29 30 |
# File 'lib/introspection/method.rb', line 28 def name @method.name.to_sym end |