Class: MilkTea::Types::Parameter
- Inherits:
-
Object
- Object
- MilkTea::Types::Parameter
- Defined in:
- lib/milk_tea/core/types/types.rb
Instance Attribute Summary collapse
-
#boundary_type ⇒ Object
readonly
Returns the value of attribute boundary_type.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#mutable ⇒ Object
readonly
Returns the value of attribute mutable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#passing_mode ⇒ Object
readonly
Returns the value of attribute passing_mode.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #children ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(name, type, mutable: false, passing_mode: :plain, boundary_type: nil) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_s ⇒ Object
Constructor Details
#initialize(name, type, mutable: false, passing_mode: :plain, boundary_type: nil) ⇒ Parameter
Returns a new instance of Parameter.
1289 1290 1291 1292 1293 1294 1295 1296 1297 |
# File 'lib/milk_tea/core/types/types.rb', line 1289 def initialize(name, type, mutable: false, passing_mode: :plain, boundary_type: nil) @name = name @type = type @mutable = mutable @passing_mode = passing_mode @boundary_type = boundary_type @hash = [self.class, type, mutable, passing_mode, boundary_type].hash freeze end |
Instance Attribute Details
#boundary_type ⇒ Object (readonly)
Returns the value of attribute boundary_type.
1287 1288 1289 |
# File 'lib/milk_tea/core/types/types.rb', line 1287 def boundary_type @boundary_type end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
1313 1314 1315 |
# File 'lib/milk_tea/core/types/types.rb', line 1313 def hash @hash end |
#mutable ⇒ Object (readonly)
Returns the value of attribute mutable.
1287 1288 1289 |
# File 'lib/milk_tea/core/types/types.rb', line 1287 def mutable @mutable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1287 1288 1289 |
# File 'lib/milk_tea/core/types/types.rb', line 1287 def name @name end |
#passing_mode ⇒ Object (readonly)
Returns the value of attribute passing_mode.
1287 1288 1289 |
# File 'lib/milk_tea/core/types/types.rb', line 1287 def passing_mode @passing_mode end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
1287 1288 1289 |
# File 'lib/milk_tea/core/types/types.rb', line 1287 def type @type end |
Instance Method Details
#children ⇒ Object
1315 1316 1317 |
# File 'lib/milk_tea/core/types/types.rb', line 1315 def children [type, boundary_type].compact end |
#eql?(other) ⇒ Boolean Also known as: ==
1303 1304 1305 1306 1307 1308 1309 |
# File 'lib/milk_tea/core/types/types.rb', line 1303 def eql?(other) other.is_a?(Parameter) && other.type == type && other.mutable == mutable && other.passing_mode == passing_mode && other.boundary_type == boundary_type end |
#to_s ⇒ Object
1299 1300 1301 |
# File 'lib/milk_tea/core/types/types.rb', line 1299 def to_s "#{name}: #{type}" end |