Class: Brujula::Object
- Inherits:
-
Object
- Object
- Brujula::Object
- Defined in:
- lib/brujula/object.rb
Direct Known Subclasses
Raml::V1_0::BaseUriParameters, Raml::V1_0::Body, Raml::V1_0::BodyType, Raml::V1_0::Header, Raml::V1_0::Method, Raml::V1_0::Property, Raml::V1_0::QueryParameter, Raml::V1_0::RamlType, Raml::V1_0::Resource, Raml::V1_0::ResourceType, Raml::V1_0::Response, Raml::V1_0::Root, Raml::V1_0::SecurityScheme, Raml::V1_0::SecuritySchemePart, Raml::V1_0::SecuritySchemeSettings, Raml::V1_0::Trait, Raml::V1_0::UriParameter
Class Attribute Summary collapse
-
.block ⇒ Object
readonly
Returns the value of attribute block.
-
.scheme(options = {}, &block) ⇒ Object
readonly
TODO.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#expand ⇒ Object
TODO.
-
#initialize(data:, parent: nil, name:) ⇒ Object
constructor
A new instance of Object.
- #root ⇒ Object
Constructor Details
#initialize(data:, parent: nil, name:) ⇒ Object
Returns a new instance of Object.
20 21 22 23 24 25 26 |
# File 'lib/brujula/object.rb', line 20 def initialize(data:, parent: nil, name:) @name = name define_singleton_method(:raw_data) { data } define_singleton_method(:parent) { parent } Brujula::ObjectParser.call(definition: self, data: data, parent: parent) end |
Class Attribute Details
.block ⇒ Object (readonly)
Returns the value of attribute block.
6 7 8 |
# File 'lib/brujula/object.rb', line 6 def block @block end |
.scheme(options = {}, &block) ⇒ Object (readonly)
TODO
8 9 10 |
# File 'lib/brujula/object.rb', line 8 def scheme @scheme end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/brujula/object.rb', line 3 def name @name end |
Instance Method Details
#expand ⇒ Object
TODO
28 29 30 |
# File 'lib/brujula/object.rb', line 28 def # TODO @representation || self end |
#root ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/brujula/object.rb', line 32 def root object = self until object.is_a? Brujula::Raml::V1_0::Root object = object.parent end object end |