Class: Avm::Entries::AutoValues::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/entries/auto_values/entry.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries_provider, path) ⇒ Object

Parameters:



20
21
22
# File 'lib/avm/entries/auto_values/entry.rb', line 20

common_constructor :entries_provider, :path do
  self.path = ::EacConfig::EntryPath.assert(path)
end

Class Method Details

.auto_value_method_name(path) ⇒ Object

Returns String.

Parameters:

Returns:

  • String



12
13
14
# File 'lib/avm/entries/auto_values/entry.rb', line 12

def auto_value_method_name(path)
  "auto_#{::EacConfig::EntryPath.assert(path).to_string.gsub('.', '_')}"
end

Instance Method Details

#auto_value_methodObject



24
25
26
# File 'lib/avm/entries/auto_values/entry.rb', line 24

def auto_value_method
  self.class.auto_value_method_name(path)
end

#found?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/avm/entries/auto_values/entry.rb', line 28

def found?
  entries_provider.respond_to?(auto_value_method, true)
end

#valueObject



32
33
34
# File 'lib/avm/entries/auto_values/entry.rb', line 32

def value
  entries_provider.if_respond(auto_value_method)
end