Class: User

Inherits:
Data
  • Object
show all
Defined in:
lib/inat-channel/data_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



113
114
115
# File 'lib/inat-channel/data_types.rb', line 113

def id
  @id
end

#loginObject (readonly)

Returns the value of attribute login

Returns:

  • (Object)

    the current value of login



113
114
115
# File 'lib/inat-channel/data_types.rb', line 113

def 
  @login
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



113
114
115
# File 'lib/inat-channel/data_types.rb', line 113

def name
  @name
end

Instance Method Details

#iconObject



114
115
116
# File 'lib/inat-channel/data_types.rb', line 114

def icon
  IC::ICONS[:user]
end

#titleObject



117
118
119
120
121
122
123
# File 'lib/inat-channel/data_types.rb', line 117

def title
  if name && !name.empty?
    name
  else
    "@#{login}"
  end
end

#urlObject



124
125
126
# File 'lib/inat-channel/data_types.rb', line 124

def url 
  "https://www.inaturalist.org/people/#{id}"
end