Class: Tabry::Models::IncludeArg

Inherits:
Object
  • Object
show all
Defined in:
lib/tabry/models/include_arg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#_rootObject (readonly)

Returns the value of attribute _root.



6
7
8
# File 'lib/tabry/models/include_arg.rb', line 6

def _root
  @_root
end

#include_nameObject (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

#flattenObject



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