Class: RubyFS::Response

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ruby_fs/response.rb

Direct Known Subclasses

CommandReply, Event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers = nil, content = nil) ⇒ Response

Returns a new instance of Response.



9
10
11
# File 'lib/ruby_fs/response.rb', line 9

def initialize(headers = nil, content = nil)
  @headers, @content = headers || {}, content || {}
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



3
4
5
# File 'lib/ruby_fs/response.rb', line 3

def content
  @content
end

#headersObject (readonly)

Returns the value of attribute headers.



3
4
5
# File 'lib/ruby_fs/response.rb', line 3

def headers
  @headers
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
16
17
# File 'lib/ruby_fs/response.rb', line 13

def ==(other)
  other.is_a?(self.class) && [:headers, :content].all? do |att|
    other.send(att) == self.send(att)
  end
end