Class: Officepod::Base
- Inherits:
-
Object
- Object
- Officepod::Base
- Includes:
- HTTParty, Authentication, Helper, Storage
- Defined in:
- lib/officepod.rb
Instance Method Summary collapse
-
#initialize(command = nil, body = {}, cookie = "") ⇒ Base
constructor
A new instance of Base.
- #operate ⇒ Object
Methods included from Storage
Methods included from Helper
#body_empty?, #command_empty?, #unsupported_command?, #validates_body, #validates_command
Methods included from Authentication
Constructor Details
#initialize(command = nil, body = {}, cookie = "") ⇒ Base
Returns a new instance of Base.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/officepod.rb', line 21 def initialize(command=nil, body={}, ="") = { headers: { "User-Agent" => "Gate4Mobile", "Content-Type" => "application/x-www-form-urlencoded", "Accept" => "application/json" } } end_point = "/server/request.php" self.instance_variable_set("@options", ) self.instance_variable_set("@end_point", end_point) self.instance_variable_set("@command", command) @options[:body] = body unless body.empty? @options[:headers]["Cookie"] = unless .empty? validates_command end |
Instance Method Details
#operate ⇒ Object
41 42 43 |
# File 'lib/officepod.rb', line 41 def operate send(@command) end |