class DiamondLang::Helpers::TargetSelector

Attributes

arguments[RW]

Public Class Methods

new(variable, arguments={}) click to toggle source
# File lib/diamond-lang/helpers/target_selector.rb, line 5
def initialize(variable, arguments={})
  @variable, @arguments = "@#{variable}", arguments
end

Public Instance Methods

<<(arguments) click to toggle source
# File lib/diamond-lang/helpers/target_selector.rb, line 8
def <<(arguments)
  @arguments = @arguments.merge arguments
end
inspect()
Alias for: to_s
mc_args() click to toggle source
# File lib/diamond-lang/helpers/target_selector.rb, line 19
def mc_args
  @arguments.map { |arg, val| val.to_arg arg }.join ','
end
to_s() click to toggle source
# File lib/diamond-lang/helpers/target_selector.rb, line 11
def to_s
  if @arguments.empty?
    @variable
  else
    @variable + "[" + mc_args + "]"
  end
end
Also aliased as: inspect