Sha256: 908ba5109111b7653eae8ad4b62293fca82af31a5a9bc85e710074487709f44b

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

module Danica
  class Function
    autoload :Name, 'danica/function/name'

    include VariablesHolder
    include DSL
    include Expressable

    attr_writer :name

    built_with(:function_block)

    def self.for(expression_class)
      build(expression_class.variables_hash) do
        expression_class.new(variables_hash)
      end
    end

    def name
      Name.new(name: @name, variables: containers)
    end

    def to(*args)
      "#{name.to(*args)} = #{function_block.to(*args)}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.7.7 lib/danica/function.rb
danica-2.7.6 lib/danica/function.rb
danica-2.7.5 lib/danica/function.rb