Last active
October 30, 2016 08:35
-
-
Save lbvf50mobile/7ecf274d318fea1b80c700ccd3c55606 to your computer and use it in GitHub Desktop.
Task: Get subarray with "from..." keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bundler/setup' | |
require 'pry-byebug' | |
hash = { | |
:text_data => "data", | |
:name => "name", | |
:from_address_select => "name from address slect", | |
:from_name => "name from name ", | |
:from_line1 => "name from line 1 ", | |
:from_line2 => "name from line 2", | |
:from_city_name => "name city name " , | |
:from_state_name => "name from state name", | |
:from_zip => "name from zip", | |
:from_country => "name from country" , | |
:to_address_select => "name to address select", | |
:to_name => "name to name n", | |
:to_line1 => "name ine1 ", | |
:to_line2 => "name line 2", | |
:to_city_name => "name to city name", | |
:to_state_name => "name to state name" , | |
:to_zip => "name to zip ", | |
:to_country => "name to country" | |
} | |
from = hash.select{|k,v| k.to_s.start_with?("from_")} | |
#binding.pry | |
puts "this is from" | |
puts from |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
solved
funct! - change input intem
funct - just create new one