Class: Asciidoctor::Diagram::ServerSource

Inherits:
Object
  • Object
show all
Includes:
DiagramSource
Defined in:
lib/asciidoctor-diagram/http/server.rb

Instance Method Summary collapse

Methods included from DiagramSource

#code, #create_image_metadata, #ensure_gem, #global_attr, #global_opt, #opt, #to_s

Constructor Details

#initialize(name, source, attributes) ⇒ ServerSource

Returns a new instance of ServerSource.



89
90
91
92
93
# File 'lib/asciidoctor-diagram/http/server.rb', line 89

def initialize(name, source, attributes)
  @name = name
  @source = source
  @attributes = attributes
end

Instance Method Details

#attr(name, default_value = nil, inherit = diagram_type) ⇒ Object



99
100
101
# File 'lib/asciidoctor-diagram/http/server.rb', line 99

def attr(name, default_value = nil, inherit = diagram_type)
  @attributes[name] || default_value
end

#base_dirObject



103
104
105
# File 'lib/asciidoctor-diagram/http/server.rb', line 103

def base_dir
  nil
end

#configObject



111
112
113
# File 'lib/asciidoctor-diagram/http/server.rb', line 111

def config
  {}
end

#diagram_typeObject



95
96
97
# File 'lib/asciidoctor-diagram/http/server.rb', line 95

def diagram_type
  @name
end

#find_command(cmd, options = nil) ⇒ Object



115
116
117
# File 'lib/asciidoctor-diagram/http/server.rb', line 115

def find_command(cmd, options = nil)
  Asciidoctor::Diagram::Which.which(cmd, options)
end

#image_nameObject



123
124
125
# File 'lib/asciidoctor-diagram/http/server.rb', line 123

def image_name
  "image"
end

#load_codeObject



107
108
109
# File 'lib/asciidoctor-diagram/http/server.rb', line 107

def load_code
  @source
end

#resolve_path(target, start = nil) ⇒ Object



119
120
121
# File 'lib/asciidoctor-diagram/http/server.rb', line 119

def resolve_path(target, start = nil)
  target
end

#should_process?(image_file, image_metadata) ⇒ Boolean

Returns:

  • (Boolean)


127
128
129
# File 'lib/asciidoctor-diagram/http/server.rb', line 127

def should_process?(image_file, )
  true
end