Class: MilkTea::ValueBinding

Inherits:
Data
  • Object
show all
Defined in:
lib/milk_tea/core/bindings/value_binding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#const_valueObject (readonly)

Returns the value of attribute const_value

Returns:

  • (Object)

    the current value of const_value



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def const_value
  @const_value
end

#flow_typeObject (readonly)

Returns the value of attribute flow_type

Returns:

  • (Object)

    the current value of flow_type



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def flow_type
  @flow_type
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def id
  @id
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def kind
  @kind
end

#mutableObject (readonly)

Returns the value of attribute mutable

Returns:

  • (Object)

    the current value of mutable



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def mutable
  @mutable
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def name
  @name
end

#storage_typeObject (readonly)

Returns the value of attribute storage_type

Returns:

  • (Object)

    the current value of storage_type



4
5
6
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 4

def storage_type
  @storage_type
end

Instance Method Details

#typeObject



5
6
7
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 5

def type
  flow_type || storage_type
end

#with_flow_type(refined_type) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/milk_tea/core/bindings/value_binding.rb', line 9

def with_flow_type(refined_type)
  ValueBinding.new(
    id:,
    name:,
    storage_type:,
    flow_type: refined_type == storage_type ? nil : refined_type,
    mutable:,
    kind:,
    const_value:,
  )
end