Class: Coolsms::Group
- Inherits:
-
Object
- Object
- Coolsms::Group
- Defined in:
- lib/coolsms/group.rb
Instance Attribute Summary collapse
-
#conditions_hash ⇒ Object
readonly
Returns the value of attribute conditions_hash.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #all ⇒ Object
- #first ⇒ Object
-
#initialize(id, conditions_hash = {}) ⇒ Group
constructor
A new instance of Group.
- #page(num) ⇒ Object
Constructor Details
#initialize(id, conditions_hash = {}) ⇒ Group
Returns a new instance of Group.
5 6 7 8 9 |
# File 'lib/coolsms/group.rb', line 5 def initialize(id, conditions_hash = {}) @id = id @arr = [] @conditions_hash = conditions_hash.with_indifferent_access end |
Instance Attribute Details
#conditions_hash ⇒ Object (readonly)
Returns the value of attribute conditions_hash.
3 4 5 |
# File 'lib/coolsms/group.rb', line 3 def conditions_hash @conditions_hash end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/coolsms/group.rb', line 3 def id @id end |
Instance Method Details
#all ⇒ Object
15 16 17 18 19 |
# File 'lib/coolsms/group.rb', line 15 def all return @all if @all recursive_next(1) @all = @arr.map(&:data).flatten end |
#first ⇒ Object
21 22 23 |
# File 'lib/coolsms/group.rb', line 21 def first page(1).data.first end |