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.
1283 1284 1285 1286 1287 1288 1289 1290 1291 |
# File 'lib/milk_tea/core/types.rb', line 1283 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.
1281 1282 1283 |
# File 'lib/milk_tea/core/types.rb', line 1281 def boundary_type @boundary_type end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
1307 1308 1309 |
# File 'lib/milk_tea/core/types.rb', line 1307 def hash @hash end |
#mutable ⇒ Object (readonly)
Returns the value of attribute mutable.
1281 1282 1283 |
# File 'lib/milk_tea/core/types.rb', line 1281 def mutable @mutable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1281 1282 1283 |
# File 'lib/milk_tea/core/types.rb', line 1281 def name @name end |
#passing_mode ⇒ Object (readonly)
Returns the value of attribute passing_mode.
1281 1282 1283 |
# File 'lib/milk_tea/core/types.rb', line 1281 def passing_mode @passing_mode end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
1281 1282 1283 |
# File 'lib/milk_tea/core/types.rb', line 1281 def type @type end |
Instance Method Details
#children ⇒ Object
1309 1310 1311 |
# File 'lib/milk_tea/core/types.rb', line 1309 def children [type, boundary_type].compact end |
#eql?(other) ⇒ Boolean Also known as: ==
1297 1298 1299 1300 1301 1302 1303 |
# File 'lib/milk_tea/core/types.rb', line 1297 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
1293 1294 1295 |
# File 'lib/milk_tea/core/types.rb', line 1293 def to_s "#{name}: #{type}" end |