Class: Burlap::Call
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#method ⇒ Object
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Call
constructor
A new instance of Call.
- #to_burlap ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Call
Returns a new instance of Call.
5 6 7 8 9 10 11 12 |
# File 'lib/burlap/call.rb', line 5 def initialize params={} params.each do |key, value| method = :"#{key}=" send(method, value) if respond_to?(method) end validate_attributes end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
3 4 5 |
# File 'lib/burlap/call.rb', line 3 def arguments @arguments end |
#headers ⇒ Object
Returns the value of attribute headers.
3 4 5 |
# File 'lib/burlap/call.rb', line 3 def headers @headers end |
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/burlap/call.rb', line 3 def method @method end |
Instance Method Details
#to_burlap ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/burlap/call.rb', line 22 def to_burlap # todo: handle headers contents = [Burlap::Node.new(:name => "method", :value => method).to_burlap] contents += arguments.map do |arg| arg.to_burlap end Burlap::Node.new(:name => "burlap:call", :value => contents.join("")).to_burlap end |