Class: CloudQuery::Schema
- Inherits:
-
Object
- Object
- CloudQuery::Schema
- Defined in:
- lib/cloud_query/schema.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Schema
constructor
A new instance of Schema.
- #to_xml ⇒ Object
Constructor Details
#initialize(name) ⇒ Schema
Returns a new instance of Schema.
5 6 7 8 |
# File 'lib/cloud_query/schema.rb', line 5 def initialize(name) @name = name @fields = [] end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
3 4 5 |
# File 'lib/cloud_query/schema.rb', line 3 def fields @fields end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/cloud_query/schema.rb', line 3 def name @name end |
Instance Method Details
#to_xml ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cloud_query/schema.rb', line 10 def to_xml Nokogiri::XML::Builder.new { |doc| doc.schema(:name => @name, :store => 'yes') { @fields.each { |field| field.to_node(doc) } } }.to_xml end |