Skip to content

Instantly share code, notes, and snippets.

@helios

helios/gist:777672

Created Jan 13, 2011
Embed
What would you like to do?
# Recode a vector based on a block
class Pippo
def recode!(vector_name)
0.upto(@cases-1) {|i|
@vectors[vector_name].data[i]=yield case_as_hash(i)
}
@vectors[vector_name].set_valid_data
end
end
class Pluto
def recode!(field)
qui devo richiamare istanza_di_pippo.recode!(field) con un blocco di codice.
end
end
@riffraff

This comment has been minimized.

Copy link

@riffraff riffraff commented Jan 13, 2011

# Recode a vector based on a block

class Pippo
def recode!(vector_name)

  0.upto(@cases-1) {|i|
    @vectors[vector_name].data[i]=yield case_as_hash(i)
  }
  @vectors[vector_name].set_valid_data
end

end

class Pluto
def recode!(field,&b)
istanza_di_pippo.recode!(field,&b)
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment