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:



935
936
937
938
939
940
# File 'lib/reve/classes.rb', line 935

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



934
935
936
# File 'lib/reve/classes.rb', line 934

def issuer_id
  @issuer_id
end

#reasonObject (readonly)

Returns the value of attribute reason



934
935
936
# File 'lib/reve/classes.rb', line 934

def reason
  @reason
end

#statusObject (readonly)

Returns the value of attribute status



934
935
936
# File 'lib/reve/classes.rb', line 934

def status
  @status
end

Instance Method Details

#is_private?Boolean

If the CharacterMedal is private (not public)

Returns:

  • (Boolean)


946
947
948
# File 'lib/reve/classes.rb', line 946

def is_private?
  ! is_public?
end

#is_public?Boolean

If the CharacterMedal is public

Returns:

  • (Boolean)


942
943
944
# File 'lib/reve/classes.rb', line 942

def is_public?
  @status == "public"
end