Class: XmpToolkitRuby::XmpValue
- Inherits:
-
Object
- Object
- XmpToolkitRuby::XmpValue
- Defined in:
- lib/xmp_toolkit_ruby/xmp_value.rb
Constant Summary collapse
- TYPES =
i[string bool int int64 float date].freeze
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, type: nil) ⇒ XmpValue
constructor
A new instance of XmpValue.
Constructor Details
#initialize(value, type: nil) ⇒ XmpValue
Returns a new instance of XmpValue.
9 10 11 12 13 14 |
# File 'lib/xmp_toolkit_ruby/xmp_value.rb', line 9 def initialize(value, type: nil) @value = value @type = type.to_sym raise ArgumentError, "Invalid type: #{type}" unless TYPES.include?(@type) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/xmp_toolkit_ruby/xmp_value.rb', line 5 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/xmp_toolkit_ruby/xmp_value.rb', line 5 def value @value end |