Class: Nerdz::HTTP
- Inherits:
-
Object
- Object
- Nerdz::HTTP
- Defined in:
- lib/nerdz/http.rb
Instance Attribute Summary collapse
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
Instance Method Summary collapse
-
#initialize ⇒ HTTP
constructor
A new instance of HTTP.
- #post(path, params = {}, data = {}, initheader = nil, &blk) ⇒ Object
- #request(action, data = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
68 69 70 |
# File 'lib/nerdz/http.rb', line 68 def @cookies end |
Instance Method Details
#post(path, params = {}, data = {}, initheader = nil, &blk) ⇒ Object
74 75 76 77 78 |
# File 'lib/nerdz/http.rb', line 74 def post(path, params = {}, data = {}, initheader = nil, &blk) self.__request(initheader) {|http, headers| http.post(path, params, data, headers, nil, &blk) } end |
#request(action, data = {}) ⇒ Object
80 81 82 |
# File 'lib/nerdz/http.rb', line 80 def request(action, data = {}) self.post('/api.php', {action: action}, data) end |