Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kennethjohnbalgos
Created November 28, 2013 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennethjohnbalgos/7696415 to your computer and use it in GitHub Desktop.
Save kennethjohnbalgos/7696415 to your computer and use it in GitHub Desktop.
Ruby Mobile Network Method [Nov2013]
def network?(min)
prefix = min.to_s[0..3]
if ['0813', '0907', '0908', '0909', '0910', '0912', '0918', '0919', '0920', '0921', '0928', '0929', '0930', '0938', '0939', '0946', '0947', '0948', '0949', '0989', '0998', '0999'].include?(prefix)
return "smart"
elsif ['0817', '0905', '0906', '0915', '0916', '0917', '0926', '0927', '0935', '0936', '0937', '0994', '0996', '0997'].include?(prefix)
return "globe"
elsif ['0922', '0923', '0925', '0932', '0933', '0934', '0942', '0943'].include?(prefix)
return "sun"
else
return nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment