Sha256: c9f70ff9c70b6c1904fe3d65b4c7db0b1ebf80d3e46c8fe714cb5893b5902a14

Contents?: true

Size: 447 Bytes

Versions: 5

Compression:

Stored size: 447 Bytes

Contents

module ApipieBindings

  class Example

    attr_reader :http_method, :path, :args, :status, :response

    def initialize(http_method, path, args, status, response)
      @http_method = http_method
      @path = path
      @args = args
      @status = status.to_i
      @response = response
    end

    def self.parse(example)
      prep = /(\w+)\ ([^\n]*)\n?(.*)?\n(\d+)\n(.*)/m.match(example)
      new(*prep[1..5]) if prep
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
apipie-bindings-0.7.0 lib/apipie_bindings/example.rb
apipie-bindings-0.6.0 lib/apipie_bindings/example.rb
apipie-bindings-0.5.0 lib/apipie_bindings/example.rb
apipie-bindings-0.4.0 lib/apipie_bindings/example.rb
apipie-bindings-0.3.0 lib/apipie_bindings/example.rb