lib/dhis2/api/base.rb in dhis2-2.2.1 vs lib/dhis2/api/base.rb in dhis2-2.3.1

- old
+ new

@@ -77,10 +77,11 @@ end end end def initialize(client, raw_data) + raw_data["display_name"] ||= raw_data["name"] # for backward compatbility with v2.19 super(raw_data) self.client = client end def update_attributes(attributes) @@ -96,9 +97,13 @@ true end def ==(other) self.class == other.class && id == other.id + end + + def update + client.put("#{self.class.resource_name}/#{id}", self.to_h) end end end end