Class: Cel::Bytes

Inherits:
Literal
  • Object
show all
Defined in:
lib/cel/ast/elements/bytes.rb

Instance Attribute Summary collapse

Attributes inherited from Literal

#type, #value

Instance Method Summary collapse

Methods inherited from Literal

to_cel_type

Methods included from CelMethods

included

Constructor Details

#initialize(value) ⇒ Bytes



7
8
9
10
# File 'lib/cel/ast/elements/bytes.rb', line 7

def initialize(value)
  super(:bytes, value)
  @string = value.pack("C*")
end

Instance Attribute Details

#stringObject (readonly) Also known as: to_ruby_type

Returns the value of attribute string.



5
6
7
# File 'lib/cel/ast/elements/bytes.rb', line 5

def string
  @string
end

Instance Method Details

#to_aryObject



12
13
14
# File 'lib/cel/ast/elements/bytes.rb', line 12

def to_ary
  [self]
end