### Home Classes Methods

### In Files

- lib/stella.rb

### Parent

Object

### Namespace

- CLASS Stella::API::Unauthorized

### Methods

- ::new
- #get
- #post
- #site_uri

### Included Modules

- HTTParty

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Stella::API

### Attributes

account[R]
httparty_opts[R]
key[R]
response[R]

### Public Class Methods

new(account=nil, key=nil, httparty_opts={}) click to toggle source

    # File lib/stella.rb, line 211
    def initialize account=nil, key=nil, httparty_opts={}
      self.class.base_uri ENV['STELLA_HOST'] || 'https://www.blamestella.com/api/v2'
      @httparty_opts = httparty_opts
      @account = account || ENV['STELLA_ACCOUNT']
      @key = key || ENV['STELLA_KEY']
      unless @account.to_s.empty? || @key.to_s.empty?
        httparty_opts[:basic_auth] ||= { :username => @account, :password => @key }
      end
    end

### Public Instance Methods

get(path, params=nil) click to toggle source

    # File lib/stella.rb, line 220
    def get path, params=nil
      opts = httparty_opts
      opts[:query] = params || {}
      execute_request :get, path, opts
    end

post(path, params=nil) click to toggle source

    # File lib/stella.rb, line 225
    def post path, params=nil
      opts = httparty_opts
      opts[:body] = params || {}
      execute_request :post, path, opts
    end

site_uri(path) click to toggle source

    # File lib/stella.rb, line 230
    def site_uri path
      uri = Addressable::URI.parse self.class.base_uri
      uri.path = uri_path(path)
      uri.to_s
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.