Sha256: 919294cf51adf4135cda20bb9077dce6ca4db4114ed97ba8d8e8272af0e43eec

Contents?: true

Size: 1.17 KB

Versions: 19

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

class Code
  class Object
    class Parameter < Object
      def initialize(*args, **_kargs, &_block)
        @raw = Dictionary.new(args.first.presence || {})
      end

      def code_name
        String.new(raw.code_get(String.new(:name)))
      end

      def code_regular?
        Boolean.new(raw.code_get(String.new(:regular?)))
      end

      def code_keyword?
        Boolean.new(raw.code_get(String.new(:keyword?)))
      end

      def code_keyword?
        Boolean.new(raw.code_get(String.new(:keyword?)))
      end

      def code_regular_splat?
        Boolean.new(raw.code_get(String.new(:regular_splat?)))
      end

      def code_keyword_splat?
        Boolean.new(raw.code_get(String.new(:keyword_splat?)))
      end

      def code_default
        Code.new(raw.code_get(String.new(:default)))
      end

      def evaluate(...)
        default.evaluate(...)
      end

      def regular?
        code_regular?.truthy?
      end

      def keyword?
        code_keyword?.truthy?
      end

      def regular_splat?
        code_regular_splat?.truthy?
      end

      def keyword_splat?
        code_keyword_splat?.truthy?
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
code-ruby-0.15.10 lib/code/object/parameter.rb
code-ruby-0.15.9 lib/code/object/parameter.rb
code-ruby-0.15.8 lib/code/object/parameter.rb
code-ruby-0.15.7 lib/code/object/parameter.rb
code-ruby-0.15.6 lib/code/object/parameter.rb
code-ruby-0.15.5 lib/code/object/parameter.rb
code-ruby-0.15.4 lib/code/object/parameter.rb
code-ruby-0.15.3 lib/code/object/parameter.rb
code-ruby-0.15.2 lib/code/object/parameter.rb
code-ruby-0.15.0 lib/code/object/parameter.rb
code-ruby-0.14.9 lib/code/object/parameter.rb
code-ruby-0.14.8 lib/code/object/parameter.rb
code-ruby-0.14.6 lib/code/object/parameter.rb
code-ruby-0.14.5 lib/code/object/parameter.rb
code-ruby-0.14.4 lib/code/object/parameter.rb
code-ruby-0.14.3 lib/code/object/parameter.rb
code-ruby-0.14.2 lib/code/object/parameter.rb
code-ruby-0.14.1 lib/code/object/parameter.rb
code-ruby-0.14.0 lib/code/object/parameter.rb