Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. require 'ostruct'
  2. objeto = OpenStruct.new({
  3.   nombres: [],
  4.   upcase: ->(nombres) {
  5.     nombres.map {|x| x.upcase}
  6.   }
  7. })
  8.  
  9. objeto.nombres += ['Sergio', 'Jose', 'Daniel', 'Gustavo']
  10.  
  11. p objeto.nombres
  12. p objeto.upcase.call(objeto.nombres)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement