Class: MilkTea::Types::Parameter
- Inherits:
-
Object
- Object
- MilkTea::Types::Parameter
- Defined in:
- lib/milk_tea/core/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.
1278 1279 1280 1281 1282 1283 1284 1285 1286 |
# File 'lib/milk_tea/core/types.rb', line 1278 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.
1276 1277 1278 |
# File 'lib/milk_tea/core/types.rb', line 1276 def boundary_type @boundary_type end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
1302 1303 1304 |
# File 'lib/milk_tea/core/types.rb', line 1302 def hash @hash end |
#mutable ⇒ Object (readonly)
Returns the value of attribute mutable.
1276 1277 1278 |
# File 'lib/milk_tea/core/types.rb', line 1276 def mutable @mutable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1276 1277 1278 |
# File 'lib/milk_tea/core/types.rb', line 1276 def name @name end |
#passing_mode ⇒ Object (readonly)
Returns the value of attribute passing_mode.
1276 1277 1278 |
# File 'lib/milk_tea/core/types.rb', line 1276 def passing_mode @passing_mode end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
1276 1277 1278 |
# File 'lib/milk_tea/core/types.rb', line 1276 def type @type end |
Instance Method Details
#children ⇒ Object
1304 1305 1306 |
# File 'lib/milk_tea/core/types.rb', line 1304 def children [type, boundary_type].compact end |
#eql?(other) ⇒ Boolean Also known as: ==
1292 1293 1294 1295 1296 1297 1298 |
# File 'lib/milk_tea/core/types.rb', line 1292 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
1288 1289 1290 |
# File 'lib/milk_tea/core/types.rb', line 1288 def to_s "#{name}: #{type}" end |