Class: Avm::Entries::AutoValues::Entry
- Inherits:
-
Object
- Object
- Avm::Entries::AutoValues::Entry
- Defined in:
- lib/avm/entries/auto_values/entry.rb
Class Method Summary collapse
Instance Method Summary collapse
- #auto_value_method ⇒ Object
- #found? ⇒ Boolean
- #initialize(entries_provider, path) ⇒ Object constructor
- #value ⇒ Object
Constructor Details
#initialize(entries_provider, path) ⇒ Object
21 22 23 |
# File 'lib/avm/entries/auto_values/entry.rb', line 21 common_constructor :entries_provider, :path do self.path = ::EacConfig::EntryPath.assert(path) end |
Class Method Details
.auto_value_method_name(path) ⇒ Object
Returns String.
13 14 15 |
# File 'lib/avm/entries/auto_values/entry.rb', line 13 def auto_value_method_name(path) "auto_#{::EacConfig::EntryPath.assert(path).to_string.gsub('.', '_')}" end |
Instance Method Details
#auto_value_method ⇒ Object
25 26 27 |
# File 'lib/avm/entries/auto_values/entry.rb', line 25 def auto_value_method self.class.auto_value_method_name(path) end |
#found? ⇒ Boolean
29 30 31 |
# File 'lib/avm/entries/auto_values/entry.rb', line 29 def found? entries_provider.respond_to?(auto_value_method, true) end |
#value ⇒ Object
33 34 35 |
# File 'lib/avm/entries/auto_values/entry.rb', line 33 def value entries_provider.if_respond(auto_value_method) end |