Sha256: dedc25c3515aeed92fba9c801a368370429829adfc6b7a2fe735a5eb23c3ce18

Contents?: true

Size: 388 Bytes

Versions: 8

Compression:

Stored size: 388 Bytes

Contents

module Rambo
  module RamlModels
    class Headers
      attr_accessor :headers

      def initialize(headers)
        @headers = headers
      end

      def add(hash)
        headers.merge!(hash)
        self
      end

      def merge!(other)
        add(other.headers)
      end

      def pretty
        JSON.pretty_generate(headers).gsub("\":", "\" =>")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rambo_ruby-0.7.1 lib/rambo/raml_models/headers.rb
rambo_ruby-0.7.0 lib/rambo/raml_models/headers.rb
rambo_ruby-0.6.0 lib/rambo/raml_models/headers.rb
rambo_ruby-0.5.0 lib/rambo/raml_models/headers.rb
rambo_ruby-0.4.0 lib/rambo/raml_models/headers.rb
rambo_ruby-0.3.3 lib/rambo/raml_models/headers.rb
rambo_ruby-0.3.2 lib/rambo/raml_models/headers.rb
rambo_ruby-0.3.1 lib/rambo/raml_models/headers.rb