Class: Steep::Interface::Block
- Inherits:
-
Object
- Object
- Steep::Interface::Block
- Defined in:
- lib/steep/interface/method_type.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #closed? ⇒ Boolean
- #free_variables ⇒ Object
-
#initialize(params:, return_type:) ⇒ Block
constructor
A new instance of Block.
- #subst(s) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(params:, return_type:) ⇒ Block
Returns a new instance of Block.
185 186 187 188 |
# File 'lib/steep/interface/method_type.rb', line 185 def initialize(params:, return_type:) @params = params @return_type = return_type end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
182 183 184 |
# File 'lib/steep/interface/method_type.rb', line 182 def params @params end |
#return_type ⇒ Object (readonly)
Returns the value of attribute return_type.
183 184 185 |
# File 'lib/steep/interface/method_type.rb', line 183 def return_type @return_type end |
Instance Method Details
#==(other) ⇒ Object
190 191 192 |
# File 'lib/steep/interface/method_type.rb', line 190 def ==(other) other.is_a?(self.class) && other.params == params && other.return_type == return_type end |
#closed? ⇒ Boolean
194 195 196 |
# File 'lib/steep/interface/method_type.rb', line 194 def closed? params.closed? && return_type.closed? end |
#free_variables ⇒ Object
205 206 207 |
# File 'lib/steep/interface/method_type.rb', line 205 def free_variables params.free_variables + return_type.free_variables end |
#subst(s) ⇒ Object
198 199 200 201 202 203 |
# File 'lib/steep/interface/method_type.rb', line 198 def subst(s) self.class.new( params: params.subst(s), return_type: return_type.subst(s) ) end |
#to_s ⇒ Object
209 210 211 |
# File 'lib/steep/interface/method_type.rb', line 209 def to_s "{ #{params} -> #{return_type} }" end |