class Telegram::Params::ChatComponent
Attributes
all_members_are_administrators[R]
can_set_sticker_set[R]
description[R]
first_name[R]
id[R]
invite_link[R]
last_name[R]
photo[R]
pinned_message[R]
sticker_set_name[R]
title[R]
type[R]
username[R]
Public Class Methods
new(params)
click to toggle source
# File lib/telegram/params/shared/chat_component.rb, line 6 def initialize(params) return if params.blank? chat_params = chat_params_permit_from(params) @id = chat_params[:id] @type = chat_params[:type] @title = chat_params[:title] @username = chat_params[:username] @first_name = chat_params[:first_name] @last_name = chat_params[:last_name] @all_members_are_administrators = chat_params[:all_members_are_administrators] @photo = chat_params[:photo] @description = chat_params[:description] @invite_link = chat_params[:invite_link] @pinned_message = chat_params[:pinned_message] @sticker_set_name = chat_params[:sticker_set_name] @can_set_sticker_set = chat_params[:can_set_sticker_set] end
Public Instance Methods
nil?()
click to toggle source
# File lib/telegram/params/shared/chat_component.rb, line 25 def nil? self.instance_variables.map{ |attribute| self.instance_variable_get(attribute) } .map(&:nil?) .reduce(:&) end
Private Instance Methods
chat_params_permit_from(params)
click to toggle source
# File lib/telegram/params/shared/chat_component.rb, line 33 def chat_params_permit_from(params) params.permit( :id, :type, :title, :username, :first_name, :last_name, :all_members_are_administrators, :photo, :description, :invite_link, :pinned_message, :sticker_set_name, :can_set_sticker_set ) end