Class: Mockolate::Request::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/mockolate/request/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attr_arr, options = {}) ⇒ Parser

Returns a new instance of Parser.



7
8
9
10
# File 'lib/mockolate/request/parser.rb', line 7

def initialize(attr_arr, options = {})
  @_attr_arr = attr_arr
  @_export_key  = options[:export_with]
end

Instance Attribute Details

#_attr_arrObject (readonly)

Returns the value of attribute _attr_arr.



4
5
6
# File 'lib/mockolate/request/parser.rb', line 4

def _attr_arr
  @_attr_arr
end

#_export_keyObject (readonly)

Returns the value of attribute _export_key.



5
6
7
# File 'lib/mockolate/request/parser.rb', line 5

def _export_key
  @_export_key
end

Instance Method Details

#parseObject



12
13
14
15
# File 'lib/mockolate/request/parser.rb', line 12

def parse
  return _parse_to_hash if _export_key
  _parse_to_array
end