Class: Safrano::Batch::EnabledHandler

Inherits:
HandlerBase show all
Defined in:
lib/odata/batch.rb

Overview

$batch enabled Handler

Constant Summary

Constants inherited from HandlerBase

HandlerBase::TREND

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HandlerBase

#allowed_transitions, #transition_end

Methods included from Transitions::GetNextTrans::ForJustTransitionEnd

#get_next_transresult

Instance Attribute Details

#body_strObject

Returns the value of attribute body_str.



133
134
135
# File 'lib/odata/batch.rb', line 133

def body_str
  @body_str
end

#boundaryObject

Returns the value of attribute boundary.



131
132
133
# File 'lib/odata/batch.rb', line 131

def boundary
  @boundary
end

#mmboundaryObject

Returns the value of attribute mmboundary.



132
133
134
# File 'lib/odata/batch.rb', line 132

def mmboundary
  @mmboundary
end

#partsObject

Returns the value of attribute parts.



134
135
136
# File 'lib/odata/batch.rb', line 134

def parts
  @parts
end

#requestObject

Returns the value of attribute request.



135
136
137
# File 'lib/odata/batch.rb', line 135

def request
  @request
end

Instance Method Details

#odata_get(_req) ⇒ Object



155
156
157
# File 'lib/odata/batch.rb', line 155

def odata_get(_req)
  [405, EMPTY_HASH, 'You cant GET $batch, POST it ']
end

#odata_post(req) ⇒ Object

here we are in the Batch handler object, and this POST should normally handle a $batch request



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/odata/batch.rb', line 139

def odata_post(req)
  @request = req

  if @request.media_type == Safrano::MP_MIXED

    @mult_request = @request.parse_multipart

    @mult_request.prepare_content_id_refs

    @mult_request.get_mult_resp(@request)

  else
    [415, EMPTY_HASH, 'Unsupported Media Type']
  end
end