Class: Pakyow::Reflection::Nested Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/reflection/nested.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, attributes: [], nested: []) ⇒ Nested

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Nested.



11
12
13
# File 'lib/pakyow/reflection/nested.rb', line 11

def initialize(name, attributes: [], nested: [])
  @name, @attributes, @nested = normalize(name), attributes, nested
end

Instance Attribute Details

#attributesObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/pakyow/reflection/nested.rb', line 9

def attributes
  @attributes
end

#nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/pakyow/reflection/nested.rb', line 9

def name
  @name
end

#nestedObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
# File 'lib/pakyow/reflection/nested.rb', line 9

def nested
  @nested
end

Instance Method Details

#named?(name) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


15
16
17
# File 'lib/pakyow/reflection/nested.rb', line 15

def named?(name)
  @name == normalize(name)
end

#plural_nameObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
# File 'lib/pakyow/reflection/nested.rb', line 19

def plural_name
  Support.inflector.pluralize(@name).to_sym
end