Class: Vigia::Adapter
- Inherits:
-
Object
- Object
- Vigia::Adapter
- Defined in:
- lib/vigia/adapter.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Structure
Instance Attribute Summary collapse
-
#source_file ⇒ Object
Returns the value of attribute source_file.
-
#structure ⇒ Object
Returns the value of attribute structure.
Class Method Summary collapse
Instance Attribute Details
#source_file ⇒ Object
Returns the value of attribute source_file.
4 5 6 |
# File 'lib/vigia/adapter.rb', line 4 def source_file @source_file end |
#structure ⇒ Object
Returns the value of attribute structure.
4 5 6 |
# File 'lib/vigia/adapter.rb', line 4 def structure @structure end |
Class Method Details
.instance ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/vigia/adapter.rb', line 16 def instance new.tap do |object| object.source_file = Vigia.config.source_file object.structure = Structure.generate(object, @template) object end end |
.setup_adapter(&block) ⇒ Object
7 8 9 10 |
# File 'lib/vigia/adapter.rb', line 7 def setup_adapter(&block) raise 'You have to call config_adapter with a block' unless block_given? @template = block end |
.template ⇒ Object
12 13 14 |
# File 'lib/vigia/adapter.rb', line 12 def template @template end |