Class: SmoothOperator::Operators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/smooth_operator/operators/base.rb

Direct Known Subclasses

Faraday, Typhoeus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(operator_class, http_verb, relative_path, data, options) ⇒ Base



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/smooth_operator/operators/base.rb', line 9

def initialize(operator_class, http_verb, relative_path, data, options)
  @operator_class, @http_verb = operator_class, http_verb

  @params, @body = strip_params(http_verb, data)

  @connection, @operator_options, @options = strip_options(options)

  @relative_path = build_relative_path(relative_path, options)

  @endpoint_user = options[:endpoint_user] || @operator_class.endpoint_user
  
  @endpoint_pass = options[:endpoint_pass] || @operator_class.endpoint_pass
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def body
  @body
end

#connectionObject (readonly)

Returns the value of attribute connection.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def connection
  @connection
end

#endpoint_passObject (readonly)

Returns the value of attribute endpoint_pass.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def endpoint_pass
  @endpoint_pass
end

#endpoint_userObject (readonly)

Returns the value of attribute endpoint_user.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def endpoint_user
  @endpoint_user
end

#http_verbObject (readonly)

Returns the value of attribute http_verb.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def http_verb
  @http_verb
end

#operator_classObject (readonly)

Returns the value of attribute operator_class.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def operator_class
  @operator_class
end

#operator_optionsObject (readonly)

Returns the value of attribute operator_options.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def operator_options
  @operator_options
end

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def options
  @options
end

#paramsObject (readonly)

Returns the value of attribute params.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def params
  @params
end

#relative_pathObject (readonly)

Returns the value of attribute relative_path.



7
8
9
# File 'lib/smooth_operator/operators/base.rb', line 7

def relative_path
  @relative_path
end