Class: NgpvanPublicEventListing::Client
- Inherits:
-
Object
- Object
- NgpvanPublicEventListing::Client
- Defined in:
- lib/ngpvan_public_event_listing/client.rb
Instance Attribute Summary collapse
-
#event_list ⇒ Object
Returns the value of attribute event_list.
-
#host ⇒ Object
Returns the value of attribute host.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #event_list? ⇒ Boolean
- #events ⇒ Object
-
#initialize(attrs = {}) ⇒ Client
constructor
A new instance of Client.
- #public_site? ⇒ Boolean
Constructor Details
#initialize(attrs = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 10 def initialize(attrs = {}) attrs.each do |key,value| if self.respond_to?("#{key}=") self.send("#{key}=", value) end end end |
Instance Attribute Details
#event_list ⇒ Object
Returns the value of attribute event_list.
8 9 10 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 8 def event_list @event_list end |
#host ⇒ Object
Returns the value of attribute host.
8 9 10 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 8 def host @host end |
#mode ⇒ Object
Returns the value of attribute mode.
8 9 10 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 8 def mode @mode end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 8 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 8 def username @username end |
Instance Method Details
#event_list? ⇒ Boolean
18 19 20 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 18 def event_list? mode == 'event-list' end |
#events ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 26 def events if event_list? load_from_event_list else load_from_public_site end end |
#public_site? ⇒ Boolean
22 23 24 |
# File 'lib/ngpvan_public_event_listing/client.rb', line 22 def public_site? mode == 'public-site' end |