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.



11
12
13
# File 'lib/ruby_fs/response.rb', line 11

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



5
6
7
# File 'lib/ruby_fs/response.rb', line 5

def content
  @content
end

#headersObject (readonly)

Returns the value of attribute headers.



5
6
7
# File 'lib/ruby_fs/response.rb', line 5

def headers
  @headers
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/ruby_fs/response.rb', line 15

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