Class: Sphere::Backends::Base
- Inherits:
-
Object
- Object
- Sphere::Backends::Base
- Defined in:
- lib/sphere/backends/base.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
- #compressed(options = {}) ⇒ Object
-
#initialize(content) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(content) ⇒ Base
Returns a new instance of Base.
21 22 23 |
# File 'lib/sphere/backends/base.rb', line 21 def initialize(content) @content = content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
19 20 21 |
# File 'lib/sphere/backends/base.rb', line 19 def content @content end |
Class Method Details
.default_options ⇒ Object
9 10 11 |
# File 'lib/sphere/backends/base.rb', line 9 def {} end |
.uri ⇒ Object
13 14 15 |
# File 'lib/sphere/backends/base.rb', line 13 def uri raise "Abstract Method" end |
Instance Method Details
#compressed(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sphere/backends/base.rb', line 25 def compressed( = {}) params = create_params!(self.class..merge()) response = Net::HTTP.post_form self.class.uri, params unless response.code == '200' STDERR.puts "ERROR during compilation. Response:" STDERR.puts response.body raise "Aborting!" end response.body end |