Class: Deplate::PseudoContainer

Inherits:
BaseElement show all
Defined in:
lib/deplate/etc.rb

Direct Known Subclasses

NullTop

Instance Attribute Summary collapse

Attributes included from CommonElement

#accum, #indent, #regNote, #top_heading

Attributes included from CommonGround

#args, #container, #deplate, #doc_slot, #doc_type, #elt, #epilogue, #indentation, #indentation_level, #keep_whitespace, #level, #level_as_list, #level_as_string, #match, #prologue, #prototype, #source, #styles, #text

Instance Method Summary collapse

Methods included from CommonElement

#add_metadata, #format_as_string, #is_explicit?, #update_id

Methods inherited from Base

def_get, #exclude?, #label_mode, #pop, set_formatter, set_rx

Methods included from CommonGround

#can_be_labelled, #element_or_particle, #filter_template, #format_element, get_explicit_id, #get_id, #heading_level, #labels_sans_id, #match_expected, #output, #output_at, #output_location, #output_preferably_at, #plain_caption?, post_process_text, #styles_as_string, #tagged_as?, #top_container, #update_args, #update_id, #update_styles, #warn_unpexpected

Methods inherited from CommonObject

class_attribute, class_attributes, class_attributes=, class_attributes_ensure, class_meta_attributes, inherited, method_missing, respond_to?

Constructor Details

#initialize(deplate, args) ⇒ PseudoContainer

Returns a new instance of PseudoContainer.



35
36
37
38
39
40
41
42
# File 'lib/deplate/etc.rb', line 35

def initialize(deplate, args)
    super(deplate, args)
    self.level_as_string = args[:level_as_string]
    @top_heading         = args[:top] || deplate.get_current_top
     = args[:metadata] || []
    @accum               = args[:accum] || []
    @destination         = ''
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



33
34
35
# File 'lib/deplate/etc.rb', line 33

def destination
  @destination
end

#registered_metadataObject

Returns the value of attribute registered_metadata.



32
33
34
# File 'lib/deplate/etc.rb', line 32

def 
  
end

Instance Method Details

#log(text, condition = nil) ⇒ Object



44
45
46
# File 'lib/deplate/etc.rb', line 44

def log(text, condition=nil)
    Deplate::Core.log(text, condition, @source)
end

#output_file_name(args = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/deplate/etc.rb', line 48

def output_file_name(args={})
    basename = args[:basename]
    rv = @top_heading ? @top_heading.output_file_name : @destination
    if basename
        return File.basename(rv)
    else
        return rv
    end
end