Sha256: c7030fb73629c656334f381467ae295e277578444ccc7565a9be3eac054157ad

Contents?: true

Size: 444 Bytes

Versions: 21

Compression:

Stored size: 444 Bytes

Contents

# Response data is data provided through the response body
# but made accssible in the ruby world
module LHC::Response::Data::Base
  def as_json
    @json ||= (@data || response.format.as_json(response))
  end

  def as_open_struct
    @open_struct ||=
      if @data
        JSON.parse(@data.to_json, object_class: OpenStruct)
      else
        response.format.as_open_struct(response)
      end
  end

  private

  attr_reader :response
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lhc-8.1.1 lib/lhc/response/data/base.rb
lhc-8.1.0 lib/lhc/response/data/base.rb
lhc-8.0.0 lib/lhc/response/data/base.rb
lhc-7.3.3 lib/lhc/response/data/base.rb
lhc-7.3.2 lib/lhc/response/data/base.rb
lhc-7.3.1 lib/lhc/response/data/base.rb
lhc-7.3.0 lib/lhc/response/data/base.rb
lhc-7.2.0 lib/lhc/response/data/base.rb
lhc-7.1.0 lib/lhc/response/data/base.rb
lhc-7.0.1 lib/lhc/response/data/base.rb
lhc-7.0.0 lib/lhc/response/data/base.rb
lhc-7.0.0.beta1 lib/lhc/response/data/base.rb
lhc-6.7.2 lib/lhc/response/data/base.rb
lhc-6.7.1 lib/lhc/response/data/base.rb
lhc-6.7.0 lib/lhc/response/data/base.rb
lhc-6.6.0.zipkin.pre.03 lib/lhc/response/data/base.rb
lhc-6.6.0.zipkin.pre.02 lib/lhc/response/data/base.rb
lhc-6.6.0.zipkin.pre.01 lib/lhc/response/data/base.rb
lhc-6.6.0.zipkin.pre lib/lhc/response/data/base.rb
lhc-6.6.0 lib/lhc/response/data/base.rb