Class: DropboxApi::Metadata::Tag
- Defined in:
- lib/dropbox_api/metadata/tag.rb
Direct Known Subclasses
AccessLevel, FileCategory, FileStatus, MemberAction, SearchMatchTypeV2, SearchOrderBy
Class Method Summary collapse
Methods inherited from Base
field, #initialize, #serialized_field, #to_hash
Constructor Details
This class inherits a constructor from DropboxApi::Metadata::Base
Class Method Details
.new(data) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/dropbox_api/metadata/tag.rb', line 4 def self.new(data) case data when ::Symbol validate(data) when Hash new(data['.tag'].to_sym) when String new(data.to_sym) else raise ArgumentError, "Invalid object for #{name}: #{data.inspect}." end end |
.validate(value) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/dropbox_api/metadata/tag.rb', line 17 def self.validate(value) if valid_values.include? value value else raise ArgumentError, "Invalid value for #{name}: #{value.inspect}" end end |