Class: Gini::Api::Document::Layout

Inherits:
Object
  • Object
show all
Defined in:
lib/gini-api/document/layout.rb

Overview

Contains document layout in XML & JSON

Instance Method Summary collapse

Constructor Details

#initialize(api, location) ⇒ Layout

Instantiate a new Gini::Api::Layout object from layout url

Parameters:

  • api (Gini::Api::Client)

    Gini::Api::Client object

  • location (String)

    Document URL


12
13
14
15
# File 'lib/gini-api/document/layout.rb', line 12

def initialize(api, location)
  @api      = api
  @location = location
end

Instance Method Details

#to_jsonString

Return layout as JSON string

Returns:

  • (String)

    Returns the layout as JSON string


27
28
29
# File 'lib/gini-api/document/layout.rb', line 27

def to_json
  @json ||= get_json
end

#to_xmlString

Return layout as XML string

Returns:

  • (String)

    Returns the layout as XML string


20
21
22
# File 'lib/gini-api/document/layout.rb', line 20

def to_xml
  @xml ||= get_xml
end