Module: Jschematic::Element
- Included in:
- Attributes::AdditionalItems, Attributes::AdditionalProperties, Attributes::Dependencies, Attributes::DivisibleBy, Attributes::Enum, Attributes::ExclusiveMaximum, Attributes::ExclusiveMinimum, Attributes::Extends, Attributes::Format::Cidr, Attributes::Format::Date, Attributes::Format::DateTime, Attributes::Format::IpAddress, Attributes::Format::Ipv6, Attributes::Format::NullFormat, Attributes::Format::Uri, Attributes::Items, Attributes::MaxItems, Attributes::MaxLength, Attributes::Maximum, Attributes::MinItems, Attributes::MinLength, Attributes::Minimum, Attributes::Pattern, Attributes::Ref, Attributes::Required, Attributes::Type, Attributes::UniqueItems, Composite
- Defined in:
- lib/jschematic/element.rb
Instance Attribute Summary collapse
- #id ⇒ Object
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
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 |
#parent ⇒ Object
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
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 |
#title ⇒ Object
12 13 14 |
# File 'lib/jschematic/element.rb', line 12 def title nil end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/jschematic/element.rb', line 24 def to_s self.class.to_s end |