Class: Backdrop::Configuration::Http

Inherits:
Object
  • Object
show all
Defined in:
lib/backdrop/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHttp

Returns a new instance of Http.



18
19
20
21
22
# File 'lib/backdrop/configuration.rb', line 18

def initialize
  @get =  Backdrop::Builders::Get
  @put = Backdrop::Builders::Put
  @http_methods = [:get, :put]
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, arg) ⇒ Object



24
25
26
27
28
29
# File 'lib/backdrop/configuration.rb', line 24

def method_missing(method, arg)
  http_method = method.to_s.gsub('=', '')
  self.class.__send__(:attr_accessor, http_method)
  send(method, arg)
  @http_methods << (http_method.to_sym)
end

Instance Attribute Details

#getObject

Returns the value of attribute get.



14
15
16
# File 'lib/backdrop/configuration.rb', line 14

def get
  @get
end

#http_methodsObject (readonly)

Returns the value of attribute http_methods.



16
17
18
# File 'lib/backdrop/configuration.rb', line 16

def http_methods
  @http_methods
end

#putObject

Returns the value of attribute put.



15
16
17
# File 'lib/backdrop/configuration.rb', line 15

def put
  @put
end