Sha256: 9179fced0546937f6cbcd855f5a3affd1edb1ee3df1a37eb7776bed9220b4456

Contents?: true

Size: 852 Bytes

Versions: 1

Compression:

Stored size: 852 Bytes

Contents

require('zerenity/list')

choice = Zerenity::List(:columns=>["Food","Energy"],:data=>[["Chips","200KJ"],["Chocolate","300KJ"]])
choice ? puts("You chose #{choice[0]} which has #{choice[1]} of energy.") : puts("You didn't choose an item.") 

choice = Zerenity::List(:columns=>["Selected","Food","Energy"],:data=>[[true,"Chips","200KJ"],[false,"Chocolate","300KJ"],[false,"Pretzels","250KJ"]],:radiolist=>true)
choice ? puts("You chose #{choice[0]} which has #{choice[1]} of energy.") : puts("You didn't choose an item.") 

choices = Zerenity::List(:columns=>["Selected","Food","Energy"],:data=>[[true,"Chips","200KJ"],[false,"Chocolate","300KJ"],[false,"Pretzels","250KJ"]],:checklist=>true,:title=>"Please select snacks")
choices ? choices.each {|row| puts("You chose #{row[0]} which has #{row[1]} of energy.")} : puts("You did not choose any items") 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zerenity-1.3 examples/example_list.rb