Class: Twilic::Core::Model::Value
- Inherits:
-
Data
- Object
- Data
- Twilic::Core::Model::Value
- Defined in:
- lib/twilic/core/model.rb
Instance Attribute Summary collapse
-
#arr ⇒ Object
readonly
Returns the value of attribute arr.
-
#bin ⇒ Object
readonly
Returns the value of attribute bin.
-
#bool ⇒ Object
readonly
Returns the value of attribute bool.
-
#f64 ⇒ Object
readonly
Returns the value of attribute f64.
-
#i64 ⇒ Object
readonly
Returns the value of attribute i64.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#map ⇒ Object
readonly
Returns the value of attribute map.
-
#str ⇒ Object
readonly
Returns the value of attribute str.
-
#u64 ⇒ Object
readonly
Returns the value of attribute u64.
Instance Method Summary collapse
Instance Attribute Details
#arr ⇒ Object (readonly)
Returns the value of attribute arr
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def arr @arr end |
#bin ⇒ Object (readonly)
Returns the value of attribute bin
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def bin @bin end |
#bool ⇒ Object (readonly)
Returns the value of attribute bool
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def bool @bool end |
#f64 ⇒ Object (readonly)
Returns the value of attribute f64
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def f64 @f64 end |
#i64 ⇒ Object (readonly)
Returns the value of attribute i64
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def i64 @i64 end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def kind @kind end |
#map ⇒ Object (readonly)
Returns the value of attribute map
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def map @map end |
#str ⇒ Object (readonly)
Returns the value of attribute str
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def str @str end |
#u64 ⇒ Object (readonly)
Returns the value of attribute u64
56 57 58 |
# File 'lib/twilic/core/model.rb', line 56 def u64 @u64 end |
Instance Method Details
#clone_value ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/twilic/core/model.rb', line 61 def clone_value case kind when ValueKind::NULL, ValueKind::BOOL, ValueKind::I64, ValueKind::U64, ValueKind::F64, ValueKind::STRING self when ValueKind::BINARY with(bin: bin.b.dup) when ValueKind::ARRAY with(arr: arr.map(&:clone_value)) when ValueKind::MAP with(map: map.map { |e| MapEntry.new(e.key, e.value.clone_value) }) else new(kind: ValueKind::NULL) end end |