Class: FBomb::Campfire
- Inherits:
-
Tinder::Campfire
- Object
- Tinder::Campfire
- FBomb::Campfire
show all
- Defined in:
- lib/fbomb/campfire.rb
Defined Under Namespace
Modules: SearchExtension, StreamExtension, UrlExtension, UserExtension
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
81
82
83
|
# File 'lib/fbomb/campfire.rb', line 81
def token
@token
end
|
Class Method Details
.new(*args, &block) ⇒ Object
64
65
66
67
68
|
# File 'lib/fbomb/campfire.rb', line 64
def Campfire.new(*args, &block)
allocate.tap do |instance|
instance.send(:initialize, *args, &block)
end
end
|
Instance Method Details
#flow_for(name) ⇒ Object
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/fbomb/campfire.rb', line 70
def flow_for(name)
name = name.to_s
flow = flows.detect{|_| _.name == name}
flow.extend(SearchExtension)
flow.extend(UserExtension)
flow.extend(StreamExtension)
flow.extend(UrlExtension)
flow.campfire = self
flow
end
|
#host ⇒ Object
91
92
93
|
# File 'lib/fbomb/campfire.rb', line 91
def host
connection.raw_connection.host
end
|
#scheme ⇒ Object
95
96
97
|
# File 'lib/fbomb/campfire.rb', line 95
def scheme
connection.raw_connection.scheme
end
|
#url ⇒ Object
83
84
85
86
87
88
89
|
# File 'lib/fbomb/campfire.rb', line 83
def url
if token
"#{ scheme }://#{ token }:X@#{ host }"
else
"#{ scheme }://#{ host }"
end
end
|