Class: DateAttribute

Inherits:
ContactAttribute show all
Defined in:
app/models/date_attribute.rb

Constant Summary

Constants inherited from ContactAttribute

ContactAttribute::AVAILABLE_TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ContactAttribute

#_create, #always_public?, #id, #id=, #json_root, #new_record?, #to_key

Methods included from ContactAttribute::CustomKeys

#async_custom_keys, #custom_keys

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



10
11
12
# File 'app/models/date_attribute.rb', line 10

def category
  @category
end

#primaryObject

Returns the value of attribute primary.



10
11
12
# File 'app/models/date_attribute.rb', line 10

def primary
  @primary
end

#publicObject

Returns the value of attribute public.



10
11
12
# File 'app/models/date_attribute.rb', line 10

def public
  @public
end

Instance Method Details

#_typeObject



16
17
18
# File 'app/models/date_attribute.rb', line 16

def _type
  self.class.name
end

#is_a_complete_birthday?Boolean

Is this a birthday with year?

Returns:

  • (Boolean)


22
23
24
# File 'app/models/date_attribute.rb', line 22

def is_a_complete_birthday?
  self.category == 'birthday' && !self.year.blank? && self.year!='-'
end