Class: Vpim::Agent::ResourceList

Inherits:
Object
  • Object
show all
Defined in:
lib/vpim/agent/calendars.rb

Overview

Return an HTML description of a list of resources accessible under this path.

Instance Method Summary collapse

Constructor Details

#initialize(description, items) ⇒ ResourceList

Returns a new instance of ResourceList.



91
92
93
94
# File 'lib/vpim/agent/calendars.rb', line 91

def initialize(description, items)
  @description = description
  @items = items
end

Instance Method Details

#get(path) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/vpim/agent/calendars.rb', line 96

def get(path)
  return <<__, Form::HTML
<html><body>
#{@description}
<ul>
  #{
    @items.map do |name,description,scheme|
"<li><a href=\"#{path.append(name,scheme)}\">#{description || name}</a></li>\n"
    end
  }
</ul>
</body></html>
__
end