Class: TreeHaver::BinaryScalarValue

Inherits:
Struct
  • Object
show all
Defined in:
lib/tree_haver/contracts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def description
  @description
end

#encodingObject

Returns the value of attribute encoding

Returns:

  • (Object)

    the current value of encoding



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def encoding
  @encoding
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def format
  @format
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def kind
  @kind
end

#raw_valueObject

Returns the value of attribute raw_value

Returns:

  • (Object)

    the current value of raw_value



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def raw_value
  @raw_value
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



768
769
770
# File 'lib/tree_haver/contracts.rb', line 768

def value
  @value
end

Instance Method Details

#to_hObject



770
771
772
773
774
775
776
777
778
779
780
# File 'lib/tree_haver/contracts.rb', line 770

def to_h
  {
    kind: kind,
    **(value.nil? ? {} : { value: value }),
    **(symbol.nil? ? {} : { symbol: symbol }),
    **(raw_value.nil? ? {} : { raw_value: raw_value }),
    **(encoding.nil? ? {} : { encoding: encoding }),
    **(format.nil? ? {} : { format: format }),
    **(description.nil? ? {} : { description: description })
  }
end