lib/zendesk2/organization.rb in zendesk2-1.9.0 vs lib/zendesk2/organization.rb in zendesk2-1.10.0

- old
+ new

@@ -1,9 +1,9 @@ +# frozen_string_literal: true class Zendesk2::Organization include Zendesk2::Model - # @return [integer] Automatically assigned when creating organization identity :id, type: :integer # ro[yes] required[no] # @return [Date] The time the organization was created attribute :created_at, type: :time # ro[yes] required[no] @@ -33,33 +33,33 @@ attribute :url, type: :string # ro[yes] required[no] def destroy! requires :identity - cistern.destroy_organization("organization" => {"id" => self.identity}) + cistern.destroy_organization('organization' => { 'id' => identity }) end def save! data = if new_record? requires :name - cistern.create_organization("organization" => self.attributes) + cistern.create_organization('organization' => attributes) else requires :identity - cistern.update_organization("organization" => self.attributes) - end.body["organization"] + cistern.update_organization('organization' => attributes) + end.body['organization'] merge_attributes(data) end # @return [Zendesk2::Users] users associated with this organization def users requires :identity cistern.users.load( - cistern.get_organization_users("organization" => {"id" => self.identity}).body["users"] + cistern.get_organization_users('organization' => { 'id' => identity }).body['users'] ) end # @return [Zendesk2::Memberships] memberships associated with this organization def memberships @@ -71,9 +71,9 @@ # @return [Zendesk2::Tickets] tickets associated with this organization def tickets requires :identity cistern.tickets.load( - cistern.get_organization_tickets("organization_id" => self.identity).body["tickets"] + cistern.get_organization_tickets('organization_id' => identity).body['tickets'] ) end end