Sha256: 8ea0c2b3ccea20a994a131f2dcfe8e2963837286585328ef9ede2feae6548118

Contents?: true

Size: 316 Bytes

Versions: 9

Compression:

Stored size: 316 Bytes

Contents

module Zapata
  module Primitive
    class Basic < Base
      def to_a
        [value]
      end

      def node
        body = @code
        type = @code.type
        OpenStruct.new(type: type, body: body)
      end

      def to_raw
        Raw.new(node.body.type, node.body.to_a.last)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
zapata-0.1.6 lib/zapata/primitive/basic.rb
zapata-0.1.5 lib/zapata/primitive/basic.rb
zapata-0.1.4 lib/zapata/primitive/basic.rb
zapata-0.1.3 lib/zapata/primitive/basic.rb
zapata-0.1.2 lib/zapata/primitive/basic.rb
zapata-0.1.1 lib/zapata/primitive/basic.rb
zapata-0.1.0 lib/zapata/primitive/basic.rb
zapata-0.0.3 lib/zapata/primitive/basic.rb
zapata-0.0.2 lib/zapata/primitive/basic.rb