Class: GatherTown
Instance Attribute Summary collapse
-
#map_id ⇒ Object
Returns the value of attribute map_id.
-
#space_id ⇒ Object
readonly
Returns the value of attribute space_id.
Instance Method Summary collapse
- #get_map ⇒ Object
-
#initialize(web_url, map_id: nil, test_connection: true) ⇒ GatherTown
constructor
A new instance of GatherTown.
- #valid_map_ids ⇒ Object
Constructor Details
#initialize(web_url, map_id: nil, test_connection: true) ⇒ GatherTown
Returns a new instance of GatherTown.
10 11 12 13 14 15 |
# File 'lib/gather_town_ruby.rb', line 10 def initialize(web_url, map_id: nil, test_connection: true) validate_web_url(web_url) set_space_id(web_url) set_map_id(map_id) get_map if test_connection end |
Instance Attribute Details
#map_id ⇒ Object
Returns the value of attribute map_id.
8 9 10 |
# File 'lib/gather_town_ruby.rb', line 8 def map_id @map_id end |
#space_id ⇒ Object (readonly)
Returns the value of attribute space_id.
7 8 9 |
# File 'lib/gather_town_ruby.rb', line 7 def space_id @space_id end |
Instance Method Details
#get_map ⇒ Object
21 22 23 24 25 |
# File 'lib/gather_town_ruby.rb', line 21 def get_map return_as_response do self.class.get("/getMap", **default_query_params) end end |
#valid_map_ids ⇒ Object
17 18 19 |
# File 'lib/gather_town_ruby.rb', line 17 def valid_map_ids get_map end |