Skip to content

Commit

Permalink
expose BurstStruct::Burst#keys
Browse files Browse the repository at this point in the history
expose @hash.keys through BurstStruct::Burst#keys
  • Loading branch information
Jordan Stephens committed Aug 21, 2014
1 parent 850068a commit 37b6882
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/yelp/burst_struct.rb
Expand Up @@ -4,6 +4,10 @@ def initialize(hash = {})
@hash = hash
end

def keys
@hash.keys
end

def method_missing(method_name, *arguments, &block)
key = find_key(method_name)

Expand Down
8 changes: 8 additions & 0 deletions spec/yelp/burst_struct_spec.rb
@@ -1,6 +1,14 @@
require 'yelp/burst_struct'

describe BurstStruct::Burst do
describe '#keys' do
subject(:struct) { BurstStruct::Burst.new(foo: 'bar', baz: 'qux') }

it 'should return' do
expect(struct.keys).to eql [:foo, :baz]
end
end

describe '#foo' do
subject(:struct) { BurstStruct::Burst.new(foo: 'bar') }

Expand Down

0 comments on commit 37b6882

Please sign in to comment.