Class: SchemaExtractor::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/schema_extractor/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Schema

Returns a new instance of Schema.



8
9
10
11
# File 'lib/schema_extractor/schema.rb', line 8

def initialize(name)
  @name = name
  @fields = []
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



5
6
7
# File 'lib/schema_extractor/schema.rb', line 5

def fields
  @fields
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/schema_extractor/schema.rb', line 6

def name
  @name
end

Instance Method Details

#add(field) ⇒ Object



13
14
15
# File 'lib/schema_extractor/schema.rb', line 13

def add(field)
  fields.push(field)
end