Module: Localwiki
- Defined in:
- lib/localwiki/client.rb,
lib/localwiki/version.rb,
lib/localwiki/resource.rb
Defined Under Namespace
Classes: Client, File, Map, Page, PageTags, Resource, Site, Tag, User
Constant Summary collapse
- VERSION =
'0.3.1'
Class Method Summary collapse
-
.make_one(type, json_hash) ⇒ Object
create instance (of correct type) for resource.
Class Method Details
.make_one(type, json_hash) ⇒ Object
create instance (of correct type) for resource
10 11 12 13 |
# File 'lib/localwiki/resource.rb', line 10 def self.make_one(type, json_hash) klass_name = type.to_s.split('_').map {|s|s.capitalize}.join Object.const_get('Localwiki').const_get(klass_name).new(json_hash) end |