Class: Bobot::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/bobot/configuration.rb

Defined Under Namespace

Classes: Page

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#app_idObject

Returns the value of attribute app_id.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def app_id
  @app_id
end

#app_secretObject

Returns the value of attribute app_secret.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def app_secret
  @app_secret
end

#asyncObject

Returns the value of attribute async.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def async
  @async
end

#debug_logObject

Returns the value of attribute debug_log.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def debug_log
  @debug_log
end

#pagesObject

Returns the value of attribute pages.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def pages
  @pages
end

#verify_tokenObject

Returns the value of attribute verify_token.



3
4
5
# File 'lib/bobot/configuration.rb', line 3

def verify_token
  @verify_token
end

Instance Method Details

#domains=(rhs) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/bobot/configuration.rb', line 5

def domains=(rhs)
  return unless rhs.present?
  if rhs.respond_to?(:to_str)
    @domains = rhs.split(",").map(&:strip)
  elsif rhs.is_a?(Array)
    @domains = rhs
  else
    raise Bobot::InvalidParameter.new(:domains, "should be a string or an array")
  end
end

#find_page_by_id(page_id) ⇒ Object



16
17
18
# File 'lib/bobot/configuration.rb', line 16

def find_page_by_id(page_id)
  pages.find { |page| page.page_id == page_id }
end

#find_page_by_slug(slug) ⇒ Object



20
21
22
# File 'lib/bobot/configuration.rb', line 20

def find_page_by_slug(slug)
  pages.find { |page| page.slug == slug }
end