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.



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

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

Instance Method Details

#get(path) ⇒ Object



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

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