Class: Faraday::Env

### Home Classes Methods

### In Files

- lib/faraday/options.rb

### Parent

Options.new(:method, :body, :url, :request, :request_headers, :ssl, :parallel_manager, :params, :response, :response_headers, :status)

### Methods

- ::member_set
- #[]
- #[]=
- #clear_body
- #custom_members
- #in_member_set?
- #inspect
- #needs_body?
- #parallel?
- #parse_body?
- #success?

### Class/Module Index

Quicksearch

- Faraday
- Faraday::Adapter
- Faraday::Adapter::EMHttp
- Faraday::Adapter::EMHttp::Manager
- Faraday::Adapter::EMHttp::Options
- Faraday::Adapter::EMSynchrony
- Faraday::Adapter::EMSynchrony::ParallelManager
- Faraday::Adapter::Excon
- Faraday::Adapter::HTTPClient
- Faraday::Adapter::NetHttp
- Faraday::Adapter::NetHttpPersistent
- Faraday::Adapter::Parallelism
- Faraday::Adapter::Patron
- Faraday::Adapter::Rack
- Faraday::Adapter::Test
- Faraday::Adapter::Test::Stub
- Faraday::Adapter::Test::Stubs
- Faraday::Adapter::Test::Stubs::NotFound
- Faraday::Adapter::Typhoeus
- Faraday::AutoloadHelper
- Faraday::ClientError
- Faraday::CompositeReadIO
- Faraday::Connection
- Faraday::ConnectionFailed
- Faraday::ConnectionOptions
- Faraday::Env
- Faraday::Error
- Faraday::FlatParamsEncoder
- Faraday::Middleware
- Faraday::MiddlewareRegistry
- Faraday::MissingDependency
- Faraday::NestedParamsEncoder
- Faraday::Options
- Faraday::ParsingError
- Faraday::ProxyOptions
- Faraday::RackBuilder
- Faraday::RackBuilder::Handler
- Faraday::RackBuilder::StackLocked
- Faraday::Request
- Faraday::Request::Authorization
- Faraday::Request::BasicAuthentication
- Faraday::Request::Instrumentation
- Faraday::Request::Instrumentation::Options
- Faraday::Request::Multipart
- Faraday::Request::Retry
- Faraday::Request::Retry::Options
- Faraday::Request::TokenAuthentication
- Faraday::Request::UrlEncoded
- Faraday::RequestOptions
- Faraday::ResourceNotFound
- Faraday::Response
- Faraday::Response::Logger
- Faraday::Response::Middleware
- Faraday::Response::RaiseError
- Faraday::SSLError
- Faraday::SSLOptions
- Faraday::TimeoutError
- Faraday::Utils
- Faraday::Utils::Headers
- Faraday::Utils::ParamsHash
- EmHttpSslPatch
- Object

No matching classes.

# Faraday::Env

### Constants

ContentLength
MethodsWithBodies

  A Set of HTTP verbs that typically send a body. If no body is set for these requests, the Content-Length header is set to 0.

StatusesWithoutBody
SuccessfulStatuses

### Public Class Methods

member_set() click to toggle source

Internal

    # File lib/faraday/options.rb, line 346
    def self.member_set
      @member_set ||= Set.new(members)
    end

### Public Instance Methods

[](key) click to toggle source

Public

    # File lib/faraday/options.rb, line 273
    def [](key)
      if in_member_set?(key)
        super(key)
      else
        custom_members[key]
      end
    end

[]=(key, value) click to toggle source

Public

    # File lib/faraday/options.rb, line 282
    def []=(key, value)
      if in_member_set?(key)
        super(key, value)
      else
        custom_members[key] = value
      end
    end

clear_body() click to toggle source

Public

    # File lib/faraday/options.rb, line 301
    def clear_body
      request_headers[ContentLength] = '0'
      self.body = ''
    end

custom_members() click to toggle source

Internal

    # File lib/faraday/options.rb, line 330
    def custom_members
      @custom_members ||= {}
    end

in_member_set?(key) click to toggle source

    # File lib/faraday/options.rb, line 336
    def in_member_set?(key)
      self.class.member_set.include?(key.to_sym)
    end

inspect() click to toggle source

    # File lib/faraday/options.rb, line 316
    def inspect
      attrs = [nil]
      members.each do |mem|
        if value = send(mem)
          attrs << "@#{mem}=#{value.inspect}"
        end
      end
      if !custom_members.empty?
        attrs << "@custom=#{custom_members.inspect}"
      end
      %(#<#{self.class}#{attrs.join(" ")}>)
    end

needs_body?() click to toggle source

Public

    # File lib/faraday/options.rb, line 296
    def needs_body?
      !body && MethodsWithBodies.include?(method)
    end

parallel?() click to toggle source

Public

    # File lib/faraday/options.rb, line 312
    def parallel?
      !!parallel_manager
    end

parse_body?() click to toggle source

Public

    # File lib/faraday/options.rb, line 307
    def parse_body?
      !StatusesWithoutBody.include?(status)
    end

success?() click to toggle source

Public

    # File lib/faraday/options.rb, line 291
    def success?
      SuccessfulStatuses.include?(status)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.