A Resource object is valid if
- it has a resource description
Included modules
- Validation
Attributes
Public class methods
new
( attributes = {} )
[show source]
# File lib/rcap/cap_1_0/resource.rb, line 35 def initialize( attributes = {} ) @mime_type = attributes[ :mime_type ] @size = attributes[ :size ] @uri = attributes[ :uri ] @digest = attributes[ :digest ] @resource_desc = attributes[ :resource_desc ] end
Public instance methods
size_in_kb
()
If size is defined returns the size in kilobytes
[show source]
# File lib/rcap/cap_1_0/resource.rb, line 54 def size_in_kb if self.size self.size.to_f/1024 end end
to_s
()
Returns a string representation of the resource of the form
resource_desc
[show source]
# File lib/rcap/cap_1_0/resource.rb, line 70 def to_s self.resource_desc end