Class: Solrengine::Ui::TokenRowComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/solrengine/ui/token_row_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token:) ⇒ TokenRowComponent

token: { symbol:, name:, balance:, icon_uri:, usd_value: }



9
10
11
# File 'app/components/solrengine/ui/token_row_component.rb', line 9

def initialize(token:)
  @token = token
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



6
7
8
# File 'app/components/solrengine/ui/token_row_component.rb', line 6

def token
  @token
end

Instance Method Details

#balanceObject



21
22
23
# File 'app/components/solrengine/ui/token_row_component.rb', line 21

def balance
  token[:balance]
end

#icon_uriObject



25
26
27
# File 'app/components/solrengine/ui/token_row_component.rb', line 25

def icon_uri
  token[:icon_uri]
end

#nameObject



17
18
19
# File 'app/components/solrengine/ui/token_row_component.rb', line 17

def name
  token[:name]
end

#symbolObject



13
14
15
# File 'app/components/solrengine/ui/token_row_component.rb', line 13

def symbol
  token[:symbol]
end

#usd_valueObject



29
30
31
# File 'app/components/solrengine/ui/token_row_component.rb', line 29

def usd_value
  token[:usd_value]
end