Class: Reve::Classes::CharacterMedal

Inherits:
Medal show all
Defined in:
lib/reve/classes.rb

Overview

Composed in CharacterMedals. Issued by the Corporation the Character is a member Attributes:

  • reason ( String ) - Why the CharacterMedal was issued

  • issuer_id ( Fixnum ) - Who issued the CharacterMedal

  • status ( String ) - public or private (presumably), if this CharacterMedal is public or private.

See Also: Medal, CharacterOtherCorporateMedal, CorporateMemberMedal, CorporateMedal

Direct Known Subclasses

CharacterOtherCorporateMedal

Instance Attribute Summary collapse

Attributes inherited from Medal

#id, #issued_at

Instance Method Summary collapse

Constructor Details

#initialize(elem) ⇒ CharacterMedal

:nodoc:



890
891
892
893
894
895
# File 'lib/reve/classes.rb', line 890

def initialize(elem) #:nodoc:
  super(elem)
  @reason = elem["reason"]
  @issuer_id = elem["issuerID"].to_i
  @status = elem["status"]
end

Instance Attribute Details

#issuer_idObject (readonly)

Returns the value of attribute issuer_id.



889
890
891
# File 'lib/reve/classes.rb', line 889

def issuer_id
  @issuer_id
end

#reasonObject (readonly)

Returns the value of attribute reason.



889
890
891
# File 'lib/reve/classes.rb', line 889

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status.



889
890
891
# File 'lib/reve/classes.rb', line 889

def status
  @status
end

Instance Method Details

#is_private?Boolean

If the CharacterMedal is private (not public)

Returns:

  • (Boolean)


901
902
903
# File 'lib/reve/classes.rb', line 901

def is_private?
  ! is_public?
end

#is_public?Boolean

If the CharacterMedal is public

Returns:

  • (Boolean)


897
898
899
# File 'lib/reve/classes.rb', line 897

def is_public?
  @status == "public"
end