class Rets::Metadata::RetsObject
Attributes
description[R]
mime_type[R]
name[R]
type[R]
Public Class Methods
build(rets_object_fragment)
click to toggle source
# File lib/rets/metadata/rets_object.rb, line 13 def self.build(rets_object_fragment) rets_object_fragment = downcase_hash_keys(rets_object_fragment) name = rets_object_fragment["visiblename"] mime_type = rets_object_fragment["mimetype"] description = rets_object_fragment["description"] type = rets_object_fragment['objecttype'] new(type, name, mime_type, description) end
new(type, name, mime_type, description)
click to toggle source
# File lib/rets/metadata/rets_object.rb, line 6 def initialize(type, name, mime_type, description) @name = name @mime_type = mime_type @description = description @type = type end
Private Class Methods
downcase_hash_keys(hash)
click to toggle source
# File lib/rets/metadata/rets_object.rb, line 36 def self.downcase_hash_keys(hash) Hash[hash.map { |k, v| [k.downcase, v] }] end
Public Instance Methods
==(other)
click to toggle source
# File lib/rets/metadata/rets_object.rb, line 29 def ==(other) name == other.name && mime_type == other.mime_type && description == other.description end
print_tree(out = $stdout)
click to toggle source
# File lib/rets/metadata/rets_object.rb, line 22 def print_tree(out = $stdout) out.puts " Object: #{type}" out.puts " Visible Name: #{name}" out.puts " Mime Type: #{mime_type}" out.puts " Description: #{description}" end