Class: ChatSDK::Cards::FieldsContext

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_sdk/cards/fields_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFieldsContext

Returns a new instance of FieldsContext.



8
9
10
# File 'lib/chat_sdk/cards/fields_context.rb', line 8

def initialize
  @nodes = []
end

Instance Attribute Details

#nodesObject (readonly)

Returns the value of attribute nodes.



6
7
8
# File 'lib/chat_sdk/cards/fields_context.rb', line 6

def nodes
  @nodes
end

Instance Method Details

#field(label, value) ⇒ Object



12
13
14
# File 'lib/chat_sdk/cards/fields_context.rb', line 12

def field(label, value)
  @nodes << Node.new(:field, attributes: {label: label, value: value})
end