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



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def description
  @description
end

#encodingObject

Returns the value of attribute encoding

Returns:

  • (Object)

    the current value of encoding



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def encoding
  @encoding
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def format
  @format
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def kind
  @kind
end

#raw_valueObject

Returns the value of attribute raw_value

Returns:

  • (Object)

    the current value of raw_value



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def raw_value
  @raw_value
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def symbol
  @symbol
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



165
166
167
# File 'lib/tree_haver/contracts.rb', line 165

def value
  @value
end

Instance Method Details

#to_hObject



166
167
168
169
170
171
172
173
174
175
176
# File 'lib/tree_haver/contracts.rb', line 166

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