Class: HBase::Response::MetaResponse
- Inherits:
-
BasicResponse
- Object
- BasicResponse
- HBase::Response::MetaResponse
- Defined in:
- lib/hbase/response/meta_response.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Instance Method Summary collapse
-
#initialize(raw_data, method) ⇒ MetaResponse
constructor
A new instance of MetaResponse.
- #parse_content(raw_data) ⇒ Object
Methods inherited from BasicResponse
Constructor Details
#initialize(raw_data, method) ⇒ MetaResponse
Returns a new instance of MetaResponse.
6 7 8 9 |
# File 'lib/hbase/response/meta_response.rb', line 6 def initialize(raw_data, method) @method = method super(raw_data) end |
Instance Attribute Details
#method ⇒ Object (readonly)
Returns the value of attribute method.
4 5 6 |
# File 'lib/hbase/response/meta_response.rb', line 4 def method @method end |
Instance Method Details
#parse_content(raw_data) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/hbase/response/meta_response.rb', line 11 def parse_content(raw_data) case @method when :list_tables if raw_data.blank? puts "There are no available tables in the HBase" return [] end doc = REXML::Document.new(raw_data) entry = doc.elements["tables"] tables = [] entry.elements.each("table") do |table| name = table.elements["name"].text.strip rescue nil t = Model::TableDescriptor.new(:name => name) tables << t end tables else puts "method '#{@method}' not supported yet" end end |