Class: Ellipses::Server::Meta::Symbol

Inherits:
Struct
  • Object
show all
Defined in:
lib/ellipses/server/meta.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dependsObject

Returns the value of attribute depends

Returns:

  • (Object)

    the current value of depends



18
19
20
# File 'lib/ellipses/server/meta.rb', line 18

def depends
  @depends
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



18
19
20
# File 'lib/ellipses/server/meta.rb', line 18

def description
  @description
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



18
19
20
# File 'lib/ellipses/server/meta.rb', line 18

def path
  @path
end

#symbolObject

Returns the value of attribute symbol

Returns:

  • (Object)

    the current value of symbol



18
19
20
# File 'lib/ellipses/server/meta.rb', line 18

def symbol
  @symbol
end

Class Method Details

.from_hash(hash) ⇒ Object



30
31
32
# File 'lib/ellipses/server/meta.rb', line 30

def self.from_hash(hash)
  from_hash_without_bogus_keys!(hash, error: Error)
end

.from_hash_with_depends(hash, *depends) ⇒ Object



34
35
36
# File 'lib/ellipses/server/meta.rb', line 34

def self.from_hash_with_depends(hash, *depends)
  from_hash_without_bogus_keys!(hash, error: Error).tap { |symbol| symbol.add_depends(*depends) }
end

Instance Method Details

#add_depends(*depends) ⇒ Object



23
24
25
26
27
28
# File 'lib/ellipses/server/meta.rb', line 23

def add_depends(*depends)
  return if depends&.empty?

  self.depends ||= []
  depends.reverse_each { |member| self.depends.unshift(member) }
end

#to_sObject



19
20
21
# File 'lib/ellipses/server/meta.rb', line 19

def to_s
  symbol
end