Class: Edoxen::ExtensionAttribute

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/edoxen/extension_attribute.rb,
sig/edoxen.rbs

Overview

Profile mechanism.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#boolean_valueBoolean? (readonly)

Returns the value of attribute boolean_value.

Returns:

  • (Boolean, nil)


363
364
365
# File 'sig/edoxen.rbs', line 363

def boolean_value
  @boolean_value
end

#date_time_valueObject (readonly)

Returns the value of attribute date_time_value.

Returns:

  • (Object)


365
366
367
# File 'sig/edoxen.rbs', line 365

def date_time_value
  @date_time_value
end

#date_valueDate? (readonly)

Returns the value of attribute date_value.

Returns:

  • (Date, nil)


364
365
366
# File 'sig/edoxen.rbs', line 364

def date_value
  @date_value
end

#float_valueFloat? (readonly)

Returns the value of attribute float_value.

Returns:

  • (Float, nil)


362
363
364
# File 'sig/edoxen.rbs', line 362

def float_value
  @float_value
end

#integer_valueInteger? (readonly)

Returns the value of attribute integer_value.

Returns:

  • (Integer, nil)


361
362
363
# File 'sig/edoxen.rbs', line 361

def integer_value
  @integer_value
end

#keyString? (readonly)

Returns the value of attribute key.

Returns:

  • (String, nil)


359
360
361
# File 'sig/edoxen.rbs', line 359

def key
  @key
end

#typeString? (readonly)

Returns the value of attribute type.

Returns:

  • (String, nil)


366
367
368
# File 'sig/edoxen.rbs', line 366

def type
  @type
end

#valueString? (readonly) Also known as: string_value

Returns the value of attribute value.

Returns:

  • (String, nil)


360
361
362
# File 'sig/edoxen.rbs', line 360

def value
  @value
end

Instance Method Details

#typed_valueObject

Convenience: read whichever typed value is set. Returns nil when none of the value fields is populated.

Returns:

  • (Object)


60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/edoxen/extension_attribute.rb', line 60

def typed_value
  case type
  when "integer"  then integer_value
  when "float"    then float_value
  when "boolean"  then boolean_value unless boolean_value.nil?
  when "date"     then date_value
  when "datetime" then date_time_value
  else
    # Default to string for back-compat with v2.0 (no `type`).
    value
  end
end