Class: Backdrop::Configuration::Http
- Inherits:
-
Object
- Object
- Backdrop::Configuration::Http
- Defined in:
- lib/backdrop/configuration.rb
Instance Attribute Summary collapse
-
#get ⇒ Object
Returns the value of attribute get.
-
#http_methods ⇒ Object
readonly
Returns the value of attribute http_methods.
-
#put ⇒ Object
Returns the value of attribute put.
Instance Method Summary collapse
-
#initialize ⇒ Http
constructor
A new instance of Http.
- #method_missing(method, arg) ⇒ Object
Constructor Details
#initialize ⇒ Http
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
#get ⇒ Object
Returns the value of attribute get.
14 15 16 |
# File 'lib/backdrop/configuration.rb', line 14 def get @get end |
#http_methods ⇒ Object (readonly)
Returns the value of attribute http_methods.
16 17 18 |
# File 'lib/backdrop/configuration.rb', line 16 def http_methods @http_methods end |
#put ⇒ Object
Returns the value of attribute put.
15 16 17 |
# File 'lib/backdrop/configuration.rb', line 15 def put @put end |