Class: Aef::Hosts::EmptyElement

Inherits:
Element
  • Object
show all
Defined in:
lib/aef/hosts/empty_element.rb

Overview

Represents an empty line as element of a hosts file

Instance Attribute Summary

Attributes inherited from Element

#cache

Instance Method Summary collapse

Methods inherited from Element

#cache_filled?, #cache_string, #inspect, #invalidate_cache!, #to_s

Constructor Details

#initialize(options = {}) ⇒ EmptyElement

Initializes an empty Element

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :cache (String)

    sets a cached String representation



32
33
34
35
36
# File 'lib/aef/hosts/empty_element.rb', line 32

def initialize(options = {})
  validate_options(options, :cache)

  @cache = options[:cache].to_s unless options[:cache].nil?
end

Instance Method Details

#generate_string(options = {}) ⇒ String (protected)

Defines the algorithm to generate a String representation from scratch.

Returns:

  • (String)

    a generated String representation



43
44
45
# File 'lib/aef/hosts/empty_element.rb', line 43

def generate_string(options = {})
  "\n"
end