Class: Virginity::XAbAdr

Inherits:
BaseField show all
Includes:
FieldValues::Text
Defined in:
lib/virginity/vcard/fields_osx.rb

Constant Summary collapse

ABADR =
"X-ABADR"

Constants inherited from BaseField

BaseField::BEGIN_REGEX, BaseField::END_REGEX, BaseField::PREF, BaseField::TYPE

Constants included from FieldCleaning

FieldCleaning::BOM_BINARY, FieldCleaning::BOM_UTF8, FieldCleaning::CASE_SENSITIVE_TYPES, FieldCleaning::CHARSET, FieldCleaning::ENCODING, FieldCleaning::LIST_NAMES, FieldCleaning::QUOTED_PRINTABLE, FieldCleaning::TYPE, FieldCleaning::X_SYNTHESIS_REF

Constants inherited from ContentLine

ContentLine::COLON_CHAR, ContentLine::GROUP, ContentLine::GROUP_DELIMITER, ContentLine::NAME

Instance Attribute Summary

Attributes inherited from ContentLine

#group, #name, #params, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods included from FieldValues::Text

#reencode!, #text, #text=, #value_to_xml

Methods inherited from BaseField

#<=>, #==, [], #extra_fields_to_xml, #field_as_json, field_register, #group_and_params_as_json, merger, named, #params_to_xml, #params_to_xml!, parse, #pref?, #raw_value=, register_field, register_for, registered?, #to_xml, types, unregister, #value, #value=, #value_to_xml

Methods included from FieldCleaning

#clean!, #clean_base64!, #clean_binary_data!, #clean_charsets!, #clean_quoted_printable_encoding!, #clean_types!, #guess_latin!, #remove_bom!, #remove_encoding_8bit!, #remove_x_synthesis_ref_params!, #uniq_params!

Methods included from Vcard21::Writer

#encode21, #vcard21line

Methods inherited from ContentLine

#<=>, #==, #api_id, #encode, #eql?, #has_name?, #hash, #initialize, line_parts, #merge_with!, merger, #param_values, #params_to_s, parse, #pretty_print, #to_field

Methods included from Encodings

#binary?, #to_ascii, #to_binary, #to_default, #to_default!, #verify_utf8ness

Constructor Details

This class inherits a constructor from Virginity::ContentLine

Class Method Details

.from_param(param) ⇒ Object

Raises:

  • (TypeError)


81
82
83
84
# File 'lib/virginity/vcard/fields_osx.rb', line 81

def self.from_param(param)
  raise TypeError unless param.is_a?(Param) and param.key.downcase == "x-format"
  from_text(param.value)
end

.from_text(t) ⇒ Object



86
87
88
# File 'lib/virginity/vcard/fields_osx.rb', line 86

def self.from_text(t)
  new(ABADR, EncodingDecoding::encode_text(t))
end

Instance Method Details

#to_paramObject



90
91
92
# File 'lib/virginity/vcard/fields_osx.rb', line 90

def to_param
  Param.new("x-format", text)
end