Skip to content

Instantly share code, notes, and snippets.

@MarsuperMammal
Created May 5, 2015 17:16
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 MarsuperMammal/4fc8645ac1e9dc96fe1a to your computer and use it in GitHub Desktop.
Save MarsuperMammal/4fc8645ac1e9dc96fe1a to your computer and use it in GitHub Desktop.
Code Snippet:
response = client.call(:get_entities) do |ctx|
ctx.cookies auth_cookies
ctx.message parentId: view_id, type: "Zone", start: start, count: count
end
Mock Output:
Get Entities API method: Given parentId=001
[{:id=>"123", :name=>"com"}]
Given parentId=123
[
{:id=>"124", :name=>"domain1"},
{:id=>"125", :name=>"domain2"},
{:id=>"126", :name=>"domain3"},
{:id=>"127", :name=>"domain4"},
{:id=>"128", :name=>"domain5"}
]
Given parentId=124
[
{:id=>"224", :name=>"sub1"}
{:id=>"225", :name=>"sub2"}
{:id=>"226", :name=>"sub3"}
]
Ideal End result:
@somehash
{'com' => 123}
{'domain1.com' => 124}
{'sub1.domain1.com' => 224,
'sub2.domain1.com' => 225,
'sub3.domain1.com' => 226}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment