Class: Bicho::Bug
- Inherits:
-
Object
- Object
- Bicho::Bug
- Defined in:
- lib/bicho/bug.rb
Class Method Summary (collapse)
-
+ (Array) where(conditions = {})
ActiveRecord like interface.
Instance Method Summary (collapse)
- - (Object) [](name, subname = nil)
- - (Object) id
-
- (Bug) initialize(client, data)
constructor
Normally you will not use this constructor as bugs will be constructed by a query result.
- - (Object) method_missing(name, *args)
- - (Object) to_s
-
- (Object) url
URL where the bug can be viewed Example: bugs.foo.com/2345.
Constructor Details
- (Bug) initialize(client, data)
Normally you will not use this constructor as bugs will be constructed by a query result
55 56 57 58 |
# File 'lib/bicho/bug.rb', line 55 def initialize(client, data) @client = client @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(name, *args)
60 61 62 |
# File 'lib/bicho/bug.rb', line 60 def method_missing(name, *args) @data[name.to_s] end |
Class Method Details
+ (Array) where(conditions = {})
ActiveRecord like interface
Requires Bicho.client to be set
alias
46 47 48 |
# File 'lib/bicho/bug.rb', line 46 def self.where(conditions={}) return Query.new(conditions) end |
Instance Method Details
- (Object) [](name, subname = nil)
74 75 76 77 78 |
# File 'lib/bicho/bug.rb', line 74 def [] name, subname = nil v = @data[name.to_s] v = v[subname.to_s] if subname # for 'internals' properties v end |
- (Object) id
64 65 66 67 68 |
# File 'lib/bicho/bug.rb', line 64 def id # we define id to not get the deprecated # warning of object_id @data['id'] end |
- (Object) to_s
70 71 72 |
# File 'lib/bicho/bug.rb', line 70 def to_s "##{id} - #{summary} (#{url})" end |
- (Object) url
URL where the bug can be viewed Example: bugs.foo.com/2345
82 83 84 |
# File 'lib/bicho/bug.rb', line 82 def url "#{@client.site_url}/#{id}" end |