Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

ruby double star argument

def my_method(a, *b, **c)
  return a, b, c
end

my_method(1)
# => [1, [], {}]

my_method(1, 2, 3, 4)
# => [1, [2, 3, 4], {}]

my_method(1, 2, 3, 4, a: 1, b: 2)
# => [1, [2, 3, 4], {:a=>1, :b=>2}]
Comment

PREVIOUS NEXT
Code Example
Ruby :: add two numbers ruby 
Ruby :: rails render json only some attributes 
Ruby :: stringio original_filename 
Ruby :: rails add index from console 
Ruby :: ruby mine show all blocks 
Ruby :: how to open ruby console 
Ruby :: ruby rails update email skip confirm email 
Ruby :: rails image_tag link size 
Ruby :: rails ago 
Ruby :: singning in using username rails 
Ruby :: comment 
Ruby :: ruby create a copy of variable 
Ruby :: rails loop 
Ruby :: api blueprint minitest rails 
R :: list all installed packages in r 
R :: how to set the first column as row names in r 
R :: r na omit column 
R :: r set dataframe column names 
R :: rmarkdown put date 
R :: remove rows in r based on row number using dplyr 
R :: ggplot2 black and white theme 
R :: how to convert numeric to date in r 
R :: convert first row to header in r 
R :: How to extract the row with min or max values? in R 
R :: n list to dataframe r 
R :: how to make the minutes zero in r 
R :: R view memory size of variables 
R :: list variables r 
R :: dotted y intercept line in ggplot 
R :: same plots for every variable together 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =