Class: Textus::Manifest::Entry::Base

Inherits:
Textus::Manifest::Entry show all
Defined in:
lib/textus/manifest/entry/base.rb

Direct Known Subclasses

Derived, Intake, Leaf, Nested

Constant Summary

Constants inherited from Textus::Manifest::Entry

PUBLISH_EACH_VARS, PUBLISH_EACH_VAR_RE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(manifest:, raw:, key:, path:, zone:, schema:, owner:, format:) ⇒ Base

rubocop:disable Metrics/ParameterLists, Lint/MissingSuper



8
9
10
11
12
13
14
15
16
17
# File 'lib/textus/manifest/entry/base.rb', line 8

def initialize(manifest:, raw:, key:, path:, zone:, schema:, owner:, format:)
  @manifest = manifest
  @raw = raw
  @key = key
  @path = path
  @zone = zone
  @schema = schema
  @owner = owner
  @format = format
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def format
  @format
end

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def key
  @key
end

#manifestObject (readonly)

Returns the value of attribute manifest.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def manifest
  @manifest
end

#ownerObject (readonly)

Returns the value of attribute owner.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def owner
  @owner
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def path
  @path
end

#rawObject (readonly)

Returns the value of attribute raw.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def raw
  @raw
end

#schemaObject (readonly)

Returns the value of attribute schema.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def schema
  @schema
end

#zoneObject (readonly)

Returns the value of attribute zone.



5
6
7
# File 'lib/textus/manifest/entry/base.rb', line 5

def zone
  @zone
end

Instance Method Details

#derived?Boolean

Returns:

  • (Boolean)


32
# File 'lib/textus/manifest/entry/base.rb', line 32

def derived? = false

#in_generator_zone?Boolean

Returns:

  • (Boolean)


28
# File 'lib/textus/manifest/entry/base.rb', line 28

def in_generator_zone? = @manifest.zone_kinds(@zone).include?(:generator)

#in_proposal_zone?Boolean

Returns:

  • (Boolean)


29
# File 'lib/textus/manifest/entry/base.rb', line 29

def in_proposal_zone?  = @manifest.zone_kinds(@zone).include?(:proposer)

#intake?Boolean

Returns:

  • (Boolean)


33
# File 'lib/textus/manifest/entry/base.rb', line 33

def intake?  = false

#kindObject

rubocop:enable Metrics/ParameterLists, Lint/MissingSuper



20
# File 'lib/textus/manifest/entry/base.rb', line 20

def kind = self.class.name.split("::").last.downcase.to_sym

#leaf?Boolean

Returns:

  • (Boolean)


34
# File 'lib/textus/manifest/entry/base.rb', line 34

def leaf?    = false

#nested?Boolean

Returns:

  • (Boolean)


31
# File 'lib/textus/manifest/entry/base.rb', line 31

def nested?  = false

#zone_writersObject



22
23
24
25
26
# File 'lib/textus/manifest/entry/base.rb', line 22

def zone_writers
  @manifest.zone_writers(@zone)
rescue UsageError => e
  raise UsageError.new("entry '#{@key}': #{e.message}")
end