Class: Cookie::Header::Attribute::Unary Abstract

Inherits:
Cookie::Header::Attribute show all
Includes:
AbstractType
Defined in:
lib/cookie/header/attribute.rb

Overview

This class is abstract.

Abstract baseclass for attributes that have no value

Direct Known Subclasses

HttpOnly, Secure

Constant Summary collapse

CACHE =
{}

Constants inherited from Cookie::Header::Attribute

Expired, REGISTRY

Class Method Summary collapse

Methods inherited from Cookie::Header::Attribute

attribute_name, coerce, register_as, #to_s

Class Method Details

.build(value) ⇒ Object



85
86
87
# File 'lib/cookie/header/attribute.rb', line 85

def self.build(value)
  value ? instance : nil
end

.instanceObject



89
90
91
92
93
# File 'lib/cookie/header/attribute.rb', line 89

def self.instance
  CACHE.fetch(attribute_name) {
    CACHE[attribute_name] = new(attribute_name)
  }
end