Class: SAFT::V2::HTML::CompanyCard
- Inherits:
-
Object
- Object
- SAFT::V2::HTML::CompanyCard
- Defined in:
- lib/saft/v2/html.rb
Instance Method Summary collapse
-
#initialize(company) ⇒ CompanyCard
constructor
A new instance of CompanyCard.
- #to_tubby ⇒ Object
Constructor Details
#initialize(company) ⇒ CompanyCard
Returns a new instance of CompanyCard.
286 287 288 |
# File 'lib/saft/v2/html.rb', line 286 def initialize(company) @company = company end |
Instance Method Details
#to_tubby ⇒ Object
290 291 292 293 294 295 296 297 298 299 300 |
# File 'lib/saft/v2/html.rb', line 290 def to_tubby Tubby.new { |t| t.div(class: "min-w-[20rem] max-w-[20rem] mr-8 mb-2") { t.div(class: "pl-2 border-l-2") { t.span("Supplier", class: "font-semibold") if @company.is_a?(Types::Supplier) t.span("Customer", class: "font-semibold") if @company.is_a?(Types::Customer) t << RenderHash.new(@company.attributes) } } } end |