Class: Trumail::Parser::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/trumail/parser/base.rb

Direct Known Subclasses

Json, Xml

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Base

Returns a new instance of Base.



9
10
11
12
# File 'lib/trumail/parser/base.rb', line 9

def initialize(data)
  @data = data
  @hash = {}
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



7
8
9
# File 'lib/trumail/parser/base.rb', line 7

def hash
  @hash
end

Class Method Details

.parse(data) ⇒ Object



14
15
16
17
18
# File 'lib/trumail/parser/base.rb', line 14

def self.parse(data)
  klass = new(data)
  klass.parse
  klass.hash
end