Class: Tabry::Models::IncludeArg
- Inherits:
-
Object
- Object
- Tabry::Models::IncludeArg
- Defined in:
- lib/tabry/models/include_arg.rb
Instance Attribute Summary collapse
-
#_root ⇒ Object
readonly
Returns the value of attribute _root.
-
#include_name ⇒ Object
readonly
Returns the value of attribute include_name.
Instance Method Summary collapse
- #flatten ⇒ Object
-
#initialize(raw:, root:) ⇒ IncludeArg
constructor
A new instance of IncludeArg.
Constructor Details
#initialize(raw:, root:) ⇒ IncludeArg
Returns a new instance of IncludeArg.
8 9 10 11 |
# File 'lib/tabry/models/include_arg.rb', line 8 def initialize(raw:, root:) @include_name = raw["include"] @_root = root end |
Instance Attribute Details
#_root ⇒ Object (readonly)
Returns the value of attribute _root.
6 7 8 |
# File 'lib/tabry/models/include_arg.rb', line 6 def _root @_root end |
#include_name ⇒ Object (readonly)
Returns the value of attribute include_name.
6 7 8 |
# File 'lib/tabry/models/include_arg.rb', line 6 def include_name @include_name end |
Instance Method Details
#flatten ⇒ Object
13 14 15 16 17 |
# File 'lib/tabry/models/include_arg.rb', line 13 def flatten inc = _root.arg_includes[include_name] raise "no include found for #{include_name}" unless inc inc.args.flatten end |