Class: Lifen::Flows
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(user) ⇒ Flows
constructor
A new instance of Flows.
Constructor Details
#initialize(user) ⇒ Flows
Returns a new instance of Flows.
4 5 6 7 |
# File 'lib/lifen/flows.rb', line 4 def initialize(user) @user = user @collection = [] end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
9 10 11 |
# File 'lib/lifen/flows.rb', line 9 def collection @collection end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
9 10 11 |
# File 'lib/lifen/flows.rb', line 9 def user @user end |
Instance Method Details
#all ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lifen/flows.rb', line 11 def all json = client.get("central/api/chats") json["_embedded"]["flows"].each do |element| flow = Flow.new(element) flow.user = user @collection << flow end collection end |