Module: Jschematic::Element

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject



16
17
18
19
20
21
22
# File 'lib/jschematic/element.rb', line 16

def id
  if @parent.respond_to?(:id)
    @parent.id + @id
  else
    @id
  end
end

#parentObject

Returns the value of attribute parent.



5
6
7
# File 'lib/jschematic/element.rb', line 5

def parent
  @parent
end

Instance Method Details

#required?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/jschematic/element.rb', line 8

def required?
  false
end

#schema_for(ref) ⇒ Object



28
29
30
# File 'lib/jschematic/element.rb', line 28

def schema_for(ref)
  parent && parent.schema_for(ref)
end

#titleObject



12
13
14
# File 'lib/jschematic/element.rb', line 12

def title
  nil
end

#to_sObject



24
25
26
# File 'lib/jschematic/element.rb', line 24

def to_s
  self.class.to_s
end