Class: Bringhurst::TypeSignature
- Inherits:
-
Object
- Object
- Bringhurst::TypeSignature
- Defined in:
- lib/bringhurst/type_signature.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#method_kind ⇒ Object
readonly
Returns the value of attribute method_kind.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(klass:, method:, method_kind:, arguments:, result:) ⇒ TypeSignature
constructor
A new instance of TypeSignature.
- #to_s ⇒ Object
Constructor Details
#initialize(klass:, method:, method_kind:, arguments:, result:) ⇒ TypeSignature
Returns a new instance of TypeSignature.
5 6 7 8 9 10 11 |
# File 'lib/bringhurst/type_signature.rb', line 5 def initialize(klass:, method:, method_kind:, arguments:, result:) @klass = klass @method = method @method_kind = method_kind @arguments = arguments @result = result end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/bringhurst/type_signature.rb', line 3 def arguments @arguments end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/bringhurst/type_signature.rb', line 3 def klass @klass end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
3 4 5 |
# File 'lib/bringhurst/type_signature.rb', line 3 def method @method end |
#method_kind ⇒ Object (readonly)
Returns the value of attribute method_kind.
3 4 5 |
# File 'lib/bringhurst/type_signature.rb', line 3 def method_kind @method_kind end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
3 4 5 |
# File 'lib/bringhurst/type_signature.rb', line 3 def result @result end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/bringhurst/type_signature.rb', line 13 def ==(other) self.class == other.class && klass == other.klass && method == other.method && method_kind == other.method_kind && arguments == other.arguments && result == other.result end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/bringhurst/type_signature.rb', line 22 def to_s "#{ method_name }: #{ (arguments + [result]).map(&:to_s).join(" -> ") }" end |