Class: Steep::TypeInference::TypeEnvBuilder
- Defined in:
- lib/steep/type_inference/type_env_builder.rb
Defined Under Namespace
Modules: Command
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
Instance Method Summary collapse
- #build(type_env) ⇒ Object
-
#initialize(*commands) ⇒ TypeEnvBuilder
constructor
A new instance of TypeEnvBuilder.
Constructor Details
#initialize(*commands) ⇒ TypeEnvBuilder
Returns a new instance of TypeEnvBuilder.
127 128 129 |
# File 'lib/steep/type_inference/type_env_builder.rb', line 127 def initialize(*commands) @commands = commands.compact end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
125 126 127 |
# File 'lib/steep/type_inference/type_env_builder.rb', line 125 def commands @commands end |
Instance Method Details
#build(type_env) ⇒ Object
131 132 133 134 135 |
# File 'lib/steep/type_inference/type_env_builder.rb', line 131 def build(type_env) commands.inject(type_env) do |env, command| command.call(env) end end |