Class: Istat::Frames::Base Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/istat/frames/base.rb

Overview

This class is abstract.

This class handles basic xml actions and content parsing for the frames

Direct Known Subclasses

Request, Response

Constant Summary collapse

DOCTYPE =

xml doytype style header

"<?xml version=\"1.0\" encoding=\"UTF-8\"?>".freeze

Instance Method Summary collapse

Constructor Details

#initialize(xml_str) ⇒ Base

creates a frame based on the passed xml string

Parameters:

  • xml_str (String)

    the xml string to use for initalization



32
33
34
35
# File 'lib/istat/frames/base.rb', line 32

def initialize(xml_str)
  @doc = REXML::Document.new(xml_str)
  @root = @doc.root
end

Instance Method Details

#to_sString

serialize the frame (as xml)

Returns:

  • (String)

    a xml structure



39
40
41
# File 'lib/istat/frames/base.rb', line 39

def to_s
  @doc.to_s
end