Transfer hash (within a class) to another class

I got a problem running the following codes:

class Environmental
def display
convert_yaml = YAML::load_file(‘nizam.yaml’)
pp convert_yaml[“System”][“Environmental”][“children”]

class EnergyManagement < Environmental
def display(nizam)
convert_yaml = YAML::load_file(‘nizam.yaml’)
@nizam = nizam
<< @nizam"nizam_out.yaml", "w"){|f| YAML.dump(convert_yaml, f)}


class Efficiency <, :blank, :risk_opportunity, :compliance,
:consequence, :current_status, :due_date, :priority, :responsibility,

a method to print out a csv record for the current Person.

def print_csv_record
#…few lines of codes here. Not relevant to the problem i think
#…few lines of codes here

def convert_ruby_struct
afiq = {“name”=>"#{blank}", #assume #{blank} is just a normal string
“title”=>“Current Targets for the #{blank} Objective:”}]}
pp afiq
e =

Then i got this error:

rb:18:in `display’: wrong number of arguments (0 for 1) (ArgumentError)

I know the problem is regarding on inserting ‘afiq’ into display method
under EnergyManagement class but do not know how to solve it. Anyone
knows how to transfer hash into another class?

I know im posting two different threads at the same time because i am
working with these two problems simultaneously. Sorry for this confusion


Problem has been solved.cheers!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs