Class: Spectro::Spec::Signature
- Inherits:
-
Object
- Object
- Spectro::Spec::Signature
- Defined in:
- lib/spectro/spec/signature.rb
Overview
Representation of the required input/output types
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_type ⇒ Object
Returns the value of attribute output_type.
-
#params_types ⇒ Object
Returns the value of attribute params_types.
Instance Method Summary collapse
- #==(signature) ⇒ Object
-
#initialize(name, params_types, output_type) ⇒ Signature
constructor
A new instance of Signature.
- #to_hash ⇒ Object
Constructor Details
#initialize(name, params_types, output_type) ⇒ Signature
Returns a new instance of Signature.
13 14 15 16 17 |
# File 'lib/spectro/spec/signature.rb', line 13 def initialize name, params_types, output_type self.name = name self.output_type = output_type self.params_types = params_types end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/spectro/spec/signature.rb', line 8 def name @name end |
#output_type ⇒ Object
Returns the value of attribute output_type.
8 9 10 |
# File 'lib/spectro/spec/signature.rb', line 8 def output_type @output_type end |
#params_types ⇒ Object
Returns the value of attribute params_types.
8 9 10 |
# File 'lib/spectro/spec/signature.rb', line 8 def params_types @params_types end |
Instance Method Details
#==(signature) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/spectro/spec/signature.rb', line 19 def == signature return \ self.name == signature.name && \ self.output_type == signature.output_type && \ self.params_types == signature.params_types end |
#to_hash ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/spectro/spec/signature.rb', line 26 def to_hash return { name: self.name, output_type: self.output_type, params_type: self.params_types } end |