Class: Germinate::Insertion

Inherits:
Object
  • Object
show all
Includes:
SharedStyleAttributes
Defined in:
lib/germinate/insertion.rb

Direct Known Subclasses

ImplicitInsertion

Constant Summary

Constants included from SharedStyleAttributes

SharedStyleAttributes::TEXT_TRANSFORMS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SharedStyleAttributes

#copy_attributes!, #copy_shared_style_attributes_from, #disable_all_transforms!, #shared_style_attributes

Constructor Details

#initialize(selector, library, template = {}) ⇒ Insertion

Returns a new instance of Insertion.



14
15
16
17
18
# File 'lib/germinate/insertion.rb', line 14

def initialize(selector, library, template={})
  copy_shared_style_attributes_from(template)
  @selector = selector
  @library  = library
end

Instance Attribute Details

#libraryObject (readonly)

Returns the value of attribute library.



9
10
11
# File 'lib/germinate/insertion.rb', line 9

def library
  @library
end

#selectorObject (readonly)

Returns the value of attribute selector.



10
11
12
# File 'lib/germinate/insertion.rb', line 10

def selector
  @selector
end

Instance Method Details

#resolveObject



24
25
26
27
28
# File 'lib/germinate/insertion.rb', line 24

def resolve
  returning(library[selector, self, self]) do |hunk|
    log.debug "Resolved #{self} to #{hunk}"
  end
end

#to_sObject



20
21
22
# File 'lib/germinate/insertion.rb', line 20

def to_s
  "Insertion[#{selector}]"
end