Sha256: 426d6bb9cec6313dc86f8d107c95b0f93c4c2ccb696bef898694fa055d54de35

Contents?: true

Size: 647 Bytes

Versions: 4

Compression:

Stored size: 647 Bytes

Contents

module Printfection
  module Actions

    module Retrieve
      def retrieve(id)
        new Printfection.get Util.join_uri(self.uri, id)
      end
    end

    module List
      def all(params={})
        Printfection.get(self.uri, params).map do |response|
          new response
        end
      end
    end

    module Create
      def create(params)
        new Printfection.post self.uri, params
      end
    end

    module Update
      def save
        Printfection.patch self.uri, changes
        true
      end
    end

    module Delete
      def delete
        Printfection.delete self.uri
        true
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
printfection-1.0.3 lib/printfection/actions.rb
printfection-1.0.2 lib/printfection/actions.rb
printfection-1.0.1 lib/printfection/actions.rb
printfection-1.0.0 lib/printfection/actions.rb