Class: MilkTea::Bindings::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



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

def const_value
  @const_value
end

#flow_typeObject (readonly)

Returns the value of attribute flow_type

Returns:

  • (Object)

    the current value of flow_type



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

def flow_type
  @flow_type
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



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

def id
  @id
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



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

def kind
  @kind
end

#mutableObject (readonly)

Returns the value of attribute mutable

Returns:

  • (Object)

    the current value of mutable



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

def mutable
  @mutable
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#storage_typeObject (readonly)

Returns the value of attribute storage_type

Returns:

  • (Object)

    the current value of storage_type



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

def storage_type
  @storage_type
end

Instance Method Details

#typeObject



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

def type
  flow_type || storage_type
end

#with_flow_type(refined_type) ⇒ Object



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

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